]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pinctrl: realtek: Fix error check for devm_platform_ioremap_resource()
authorChen Ni <nichen@iscas.ac.cn>
Thu, 12 Mar 2026 03:18:20 +0000 (11:18 +0800)
committerLinus Walleij <linusw@kernel.org>
Mon, 16 Mar 2026 10:13:51 +0000 (11:13 +0100)
Replace NULL check with IS_ERR() for devm_platform_ioremap_resource()
return value. Use dev_err_probe() for error handling to maintain
consistency with the rest of the probe function.

Fixes: b7f698b22b8b ("pinctrl: realtek: Switch to use devm functions")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Signed-off-by: Linus Walleij <linusw@kernel.org>
drivers/pinctrl/realtek/pinctrl-rtd.c

index 60dfb39bc986dd0c58cfa725dfe3df525e8b098a..7836a15afe44643adc99cef7155c602fbb8941ec 100644 (file)
@@ -574,8 +574,9 @@ int rtd_pinctrl_probe(struct platform_device *pdev, const struct rtd_pinctrl_des
                return -ENOMEM;
 
        data->base = devm_platform_ioremap_resource(pdev, 0);
-       if (!data->base)
-               return -ENOMEM;
+       if (IS_ERR(data->base))
+               return dev_err_probe(&pdev->dev, PTR_ERR(data->base),
+                                    "Failed to ioremap resource\n");
 
        data->dev = &pdev->dev;
        data->info = desc;