From patchwork Mon May 7 01:40:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 10383139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 78FFA60353 for ; Mon, 7 May 2018 01:33:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6188A204C3 for ; Mon, 7 May 2018 01:33:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5655F285FB; Mon, 7 May 2018 01:33:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3CBE5204C3 for ; Mon, 7 May 2018 01:33:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=mjiQbwNpcd35LgKYO56fTtD7H8Pv8Uv/C+Wt8+QkYes=; b=cGJgldvjnhFr4J AOuiAiCDTecMSyD6/ad5tcBskO4WZbsAtRFFVfXNiMgcnw/SSG6n+KWVgAUb/DOiHEoAYx3ehkztg egZQ7uiR3AZm2Wm2qCz9ogaVImhned/I7mhTjapOD5jE19Yq81AskfN8RxZc+PNspjoBhfEPUaEG0 9XcniZi56L/O6MZ99VLJHVyfNKRiy14AljycEAgH5cEXggTlBrn7UqRrkNB4sCXp+DL4YB7lzk1FI 7ESlvHPDgQeJDyLsmZJd2ZPd6onHQ0V/HqSRaMl0iQaTbvf9bd5M74r59Gh1sSEBA4U66JxuoVd8W SGO3EcH5WRFXZZwYuZWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fFV1Q-0006Hg-1R; Mon, 07 May 2018 01:33:00 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fFV1A-00065D-Rk for linux-arm-kernel@lists.infradead.org; Mon, 07 May 2018 01:32:46 +0000 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 01DAD16147DDB; Mon, 7 May 2018 09:32:20 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.361.1; Mon, 7 May 2018 09:32:14 +0800 From: Wei Yongjun To: , , Manivannan Sadhasivam Subject: [PATCH -next] gpio: Fix return value check in owl_gpio_probe() Date: Mon, 7 May 2018 01:40:24 +0000 Message-ID: <1525657224-88189-1-git-send-email-weiyongjun1@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180506_183245_172812_00A9174A X-CRM114-Status: GOOD ( 10.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-gpio@vger.kernel.org, kernel-janitors@vger.kernel.org, Wei Yongjun , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In case of error, the function of_iomap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: d3654d38809c ("gpio: Add gpio driver for Actions OWL S900 SoC") Signed-off-by: Wei Yongjun --- drivers/gpio/gpio-owl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-owl.c b/drivers/gpio/gpio-owl.c index 3546362..f35e80f 100644 --- a/drivers/gpio/gpio-owl.c +++ b/drivers/gpio/gpio-owl.c @@ -128,8 +128,8 @@ static int owl_gpio_probe(struct platform_device *pdev) return -ENOMEM; gpio->base = of_iomap(dev->of_node, 0); - if (IS_ERR(gpio->base)) - return PTR_ERR(gpio->base); + if (!gpio->base) + return -ENOMEM; /* * Get the number of gpio's for this bank. If none specified,