summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Ni <nichen@iscas.ac.cn>2026-03-12 11:18:20 +0800
committerLinus Walleij <linusw@kernel.org>2026-03-16 11:13:51 +0100
commit9ba4ef6847ba53dea92efce47c9e044fbf6d6dcf (patch)
tree9621e8086687744e8af336efde63a91042d347ab
parentfc334ad4a1d110754b3ec3abd0805d1ae1cfcc4b (diff)
downloadlinux-9ba4ef6847ba53dea92efce47c9e044fbf6d6dcf.tar.gz
linux-9ba4ef6847ba53dea92efce47c9e044fbf6d6dcf.zip
pinctrl: realtek: Fix error check for devm_platform_ioremap_resource()
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>
-rw-r--r--drivers/pinctrl/realtek/pinctrl-rtd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pinctrl/realtek/pinctrl-rtd.c b/drivers/pinctrl/realtek/pinctrl-rtd.c
index 60dfb39bc986..7836a15afe44 100644
--- a/drivers/pinctrl/realtek/pinctrl-rtd.c
+++ b/drivers/pinctrl/realtek/pinctrl-rtd.c
@@ -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;