mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 02:33:57 +00:00
pinctrl: Fix return value about devm_platform_ioremap_resource()
When call function devm_platform_ioremap_resource(), we should use IS_ERR()
to check the return value and return PTR_ERR() if failed.
Fixes: 4b024225c4
("pinctrl: use devm_platform_ioremap_resource() to simplify code")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Link: https://lore.kernel.org/r/1590234326-2194-1-git-send-email-yangtiezhu@loongson.cn
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
6fe7c07a9a
commit
b5d9ff10dc
@ -1406,7 +1406,7 @@ static int __init bcm281xx_pinctrl_probe(struct platform_device *pdev)
|
||||
pdata->reg_base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(pdata->reg_base)) {
|
||||
dev_err(&pdev->dev, "Failed to ioremap MEM resource\n");
|
||||
return -ENODEV;
|
||||
return PTR_ERR(pdata->reg_base);
|
||||
}
|
||||
|
||||
/* Initialize the dynamic part of pinctrl_desc */
|
||||
|
@ -1019,7 +1019,7 @@ static int atmel_pinctrl_probe(struct platform_device *pdev)
|
||||
|
||||
atmel_pioctrl->reg_base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(atmel_pioctrl->reg_base))
|
||||
return -EINVAL;
|
||||
return PTR_ERR(atmel_pioctrl->reg_base);
|
||||
|
||||
atmel_pioctrl->clk = devm_clk_get(dev, NULL);
|
||||
if (IS_ERR(atmel_pioctrl->clk)) {
|
||||
|
Loading…
Reference in New Issue
Block a user