From patchwork Wed Jan 25 14:03:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9537145 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 B4133601D7 for ; Wed, 25 Jan 2017 14:04:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A72AC28306 for ; Wed, 25 Jan 2017 14:04:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99C222832B; Wed, 25 Jan 2017 14:04:58 +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=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 41A4928306 for ; Wed, 25 Jan 2017 14:04:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cWOBz-00033q-Bw; Wed, 25 Jan 2017 14:04:55 +0000 Received: from mail-pf0-f195.google.com ([209.85.192.195]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cWOBw-00032p-A3 for linux-arm-kernel@lists.infradead.org; Wed, 25 Jan 2017 14:04:53 +0000 Received: by mail-pf0-f195.google.com with SMTP id 19so14443023pfo.3 for ; Wed, 25 Jan 2017 06:04:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uXUlXoYOn316lQ19nxaLfDUCGfr903FHDSJdKbqllqU=; b=UOmhp81r26Ekb6coRVphEFBwQNh9zWDrAnolCA1v+9QZ2VdlHn2Slrfpy2hDQmPVgA SfFvVJgwo0AZ7LSSnXXsVApS7Q+dX7xoecSw0DyrSbAwmCZ3Auu/8W7K67yRb3n7xdmG M2OMTV3I+B22P5V7d6/V1KkN+WpBGY31v+mL2Z7roZd76I68u7UsGK1qwxoKDilE0N6o ByP3/6uFKcEWhOxX99FtKKrHPO9EryhvaMm6tvQBi4iOJ196ki3vhotquIN1HHzGqOk4 piOl8YB8rEsv3PGP4//vOyF/1babJGPBI/wkIwHM1ZIzmXmOE4S1kCc6wbeBUb4piKRt SyEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uXUlXoYOn316lQ19nxaLfDUCGfr903FHDSJdKbqllqU=; b=r1ftq5xQlvlMDy+eaJwhLFsS1fIOJQYJh69jQYIbk0IDoTC9WAzuzW5cY1lBZ7KTeK sKIvuINdZwaClb2Fcz86bs2RdxiwdcGyYpb095ol4dK1GCo4UoAdCw5qLIcvKHKVMLPy u4BRCaqR5GPHWjuTK+ZUtp28McTmmHhSwzSdDlu/ef/1Tisa1X4axYq7p8U1DyMsik3A mgz809wRFqScfMseGyJXtzC/J1lemHMecfCyHWKy7QgoKYQ6X/p4PV3ugoJnpD6Ycwab L+HNLE2Y/0yUWkzFpXrOHExxhXIbTFgJuxbKZAzPKDH3aD92tA7U462WHvrtNeXnfKGo 56qQ== X-Gm-Message-State: AIkVDXJjOYCBu8CqG1EZInNg9tgNc7EnqbgNUp46e07elVIAE2ZsuSIqO676o/7L+BUYIg== X-Received: by 10.98.7.150 with SMTP id 22mr47064248pfh.69.1485353007758; Wed, 25 Jan 2017 06:03:27 -0800 (PST) Received: from localhost.localdomain.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id z77sm1637013pfk.47.2017.01.25.06.03.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jan 2017 06:03:27 -0800 (PST) From: Wei Yongjun To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi , Linus Walleij Subject: [PATCH -next] pinctrl: samsung: Fix return value check in samsung_pinctrl_get_soc_data() Date: Wed, 25 Jan 2017 14:03:21 +0000 Message-Id: <20170125140321.23911-1-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170125_060452_386552_927F93C2 X-CRM114-Status: GOOD ( 10.67 ) 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, linux-samsung-soc@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 From: Wei Yongjun In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 8b1bd11c1f8f ("pinctrl: samsung: Add the support the multiple IORESOURCE_MEM for one pin-bank") Signed-off-by: Wei Yongjun --- drivers/pinctrl/samsung/pinctrl-samsung.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 3bc925f..9c03eab 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -1009,7 +1009,7 @@ samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d, res = platform_get_resource(pdev, IORESOURCE_MEM, i); virt_base[i] = devm_ioremap(&pdev->dev, res->start, resource_size(res)); - if (IS_ERR(virt_base[i])) + if (!virt_base[i]) return ERR_PTR(-EIO); }