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: 909501 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40fQ8z4CHDz9s2k for ; Mon, 7 May 2018 11:32:35 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751893AbeEGBcd (ORCPT ); Sun, 6 May 2018 21:32:33 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7656 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751444AbeEGBcd (ORCPT ); Sun, 6 May 2018 21:32:33 -0400 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 CC: Wei Yongjun , , , 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 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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,