summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/samsung/pinctrl-samsung.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2017-02-05 16:58:49 +0100
committerLinus Walleij <linus.walleij@linaro.org>2017-02-13 15:48:18 +0100
commitbaafacab092e282c69f57a90dc2c4ed25b083e22 (patch)
treee2eb04a047198a270fbb00f302ed615c2f4da8ea /drivers/pinctrl/samsung/pinctrl-samsung.c
parentpinctrl: intel: unlock on error in intel_config_set_pull() (diff)
downloadlinux-baafacab092e282c69f57a90dc2c4ed25b083e22.tar.xz
linux-baafacab092e282c69f57a90dc2c4ed25b083e22.zip
pinctrl: samsung: Fix return value check in samsung_pinctrl_get_soc_data()
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 <weiyongjun1@huawei.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/samsung/pinctrl-samsung.c')
-rw-r--r--drivers/pinctrl/samsung/pinctrl-samsung.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
index d601b5303e73..f9ddba7decc1 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;