mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-26 14:14:01 +08:00
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: 8b1bd11c1f
("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>
This commit is contained in:
parent
aa1dd80f80
commit
baafacab09
@ -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++) {
|
for (i = 0; i < ctrl->nr_ext_resources + 1; i++) {
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, i);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, i);
|
||||||
virt_base[i] = devm_ioremap(&pdev->dev, res->start,
|
virt_base[i] = devm_ioremap_resource(&pdev->dev, res);
|
||||||
resource_size(res));
|
|
||||||
if (IS_ERR(virt_base[i]))
|
if (IS_ERR(virt_base[i]))
|
||||||
return ERR_PTR(-EIO);
|
return ERR_CAST(virt_base[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
bank = d->pin_banks;
|
bank = d->pin_banks;
|
||||||
|
Loading…
Reference in New Issue
Block a user