From patchwork Sun Feb 5 15:58:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9556137 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 37157602B1 for ; Sun, 5 Feb 2017 16:03:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BBB61FE95 for ; Sun, 5 Feb 2017 16:03:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D10726785; Sun, 5 Feb 2017 16:03:35 +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 0EFC61FE95 for ; Sun, 5 Feb 2017 16:03:34 +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 1caPHn-0004y3-Ch; Sun, 05 Feb 2017 16:03:31 +0000 Received: from mail-pg0-f67.google.com ([74.125.83.67]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1caPEf-00039s-2i for linux-arm-kernel@lists.infradead.org; Sun, 05 Feb 2017 16:00:19 +0000 Received: by mail-pg0-f67.google.com with SMTP id 75so6759290pgf.3 for ; Sun, 05 Feb 2017 07:59:56 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=tL8qJfOnsNXo9DUdcc2Kb2VL1LeRIk4i6BA42/zX5QQ=; b=XmQxnPQQ2THh5MsUPYjTQapHnNYs16B9/1M/fcPtYUltntREmTyH/uyXA8AgDU98ww /hTcCEokC45+DiXCzUNQmiTZhcZvqC9PAYdvGysqesI/D5AtF9LV3fd0aIDj84zzdRiF xt1Nx3+oyW1sEuRi7DMebHvWyDG5oP5OG+TT2sfKH4msQWXZ9tlm85gBPotickfJNpyX XqH2Y8g9Dy/HOtHeJ/t6qrGYWCiBMNwhZmksVjNQp3iKPLumKkbbh6Jl+OmdG+iMxjKO /TPAKSop/OAhUsG42fQaZSdONBVx8EELoxbu0tky1mKxIlP/ROQnQiWntY8RjeKDc+FD bNIA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=tL8qJfOnsNXo9DUdcc2Kb2VL1LeRIk4i6BA42/zX5QQ=; b=MweKrJa95kLrhExiwXXCdraYq1tr8o+6KSjOr8GNZS+74DwHRxjxhvLMJbWes/bDgs hGLkmpOcjmviG40RZCWAynDXvV6CWUBp1CWDasoT8A9qUvETu+xxqMi1b1ElqmrrwjTf uIlzlT8n6aSwuWcEqmEwa5iaERyZO9Ejz8bLrF/d1XANLt4Bkrq7nVTJMM4NrhQYIbCo N1sIB6h7w6PZePs3EKdQhn385ZbaCMksPZ8U5VfnIXgd2M6nQMgUhOJFCVSkgNs06vRU X5gBu98wQ3aDZTla15yJ4pWz/CJHrV69kBYUs9ht9tOwRV4YnWgg/j3GA1kPObmCgfNM Hx2g== X-Gm-Message-State: AIkVDXIV+XYiHK1MkF6L9p+1PMMFNEkgujRUDkj5bMtjZZsuZqTyeEHaHaWZn7Go7QvPqw== X-Received: by 10.99.6.140 with SMTP id 134mr8485767pgg.53.1486310336211; Sun, 05 Feb 2017 07:58:56 -0800 (PST) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id p6sm82094902pfg.6.2017.02.05.07.58.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Feb 2017 07:58:55 -0800 (PST) From: Wei Yongjun To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij Subject: [PATCH -next v2] pinctrl: samsung: Fix return value check in samsung_pinctrl_get_soc_data() Date: Sun, 5 Feb 2017 15:58:49 +0000 Message-Id: <20170205155849.4362-1-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170125140321.23911-1-weiyj.lk@gmail.com> References: <20170125140321.23911-1-weiyj.lk@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170205_080017_197444_DBE83786 X-CRM114-Status: GOOD ( 10.69 ) 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(). Fix by using devm_ioremap_resource instead of devm_ioremap. Fixes: 8b1bd11c1f8f ("pinctrl: samsung: Add the support the multiple IORESOURCE_MEM for one pin-bank") Signed-off-by: Wei Yongjun Reviewed-by: Krzysztof Kozlowski --- v1 -> v2: use devm_ioremap_resource instead of devm_ioremap --- drivers/pinctrl/samsung/pinctrl-samsung.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index d79eada..6dec061 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -988,10 +988,9 @@ samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d, for (i = 0; i < ctrl->nr_ext_resources + 1; i++) { res = platform_get_resource(pdev, IORESOURCE_MEM, i); - virt_base[i] = devm_ioremap(&pdev->dev, res->start, - resource_size(res)); + virt_base[i] = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(virt_base[i])) - return ERR_PTR(-EIO); + return ERR_CAST(virt_base[i]); } bank = d->pin_banks;