From patchwork Mon May 7 06:25:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 10383239 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 9DC3E6037F for ; Mon, 7 May 2018 06:18:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B266288A9 for ; Mon, 7 May 2018 06:18:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D65B288CD; Mon, 7 May 2018 06:18:27 +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 B7726288A9 for ; Mon, 7 May 2018 06:18:26 +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:References:In-Reply-To: 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: List-Owner; bh=+WMHM3yjCfbFcEJjJ1jiChicYSiO8nyn8p1eunDb6Co=; b=JPskX+zaC00Zew QR5j/yg+MoP+EJ1v4Lz6F+WLvbcCmVMU1bUt6t4q485Xs+sRNO8X1QUy24JJkaWPTGQZOHORExKpu Rca9N805o3WF9euaqkGyYEqRfzsdsHkUZDou8jes3TSc9sbMdWG5tCP4zv9cRlc7gSYkhMCYO+1Op DQ31v9ZBYdCYET8eVsqzoosyOdOe1oKTTyp6DV/NdwzQzteJbhFykOug6ESPaAvbk62/uzu1zXqQm +I94LgDFf55bhd0xYatWUezv1evYqEwVaHJ9ezYkPg22tioAnWBbmcbkvdJCRaeoB/ExX2XQ9h/cP HwveXg4Wf0B7Ly3cyjeg==; 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 1fFZTY-0003p2-CH; Mon, 07 May 2018 06:18:20 +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 1fFZTV-0003o6-HV for linux-arm-kernel@lists.infradead.org; Mon, 07 May 2018 06:18:19 +0000 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A969856291457; Mon, 7 May 2018 14:17:52 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.361.1; Mon, 7 May 2018 14:17:46 +0800 From: Wei Yongjun To: , , Manivannan Sadhasivam Subject: [PATCH -next v2] gpio: owl: Fix return value check in owl_gpio_probe() Date: Mon, 7 May 2018 06:25:56 +0000 Message-ID: <1525674356-39189-1-git-send-email-weiyongjun1@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1525657224-88189-1-git-send-email-weiyongjun1@huawei.com> References: <1525657224-88189-1-git-send-email-weiyongjun1@huawei.com> 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_231817_783195_F62D1D06 X-CRM114-Status: GOOD ( 11.37 ) 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 Acked-by: Manivannan Sadhasivam --- v1 -> v2: return -ENXIO instead of -ENOMEM --- 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 -ENXIO; /* * Get the number of gpio's for this bank. If none specified,