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: b7f698b22b ("pinctrl: realtek: Switch to use devm functions")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Signed-off-by: Linus Walleij <linusw@kernel.org>
This commit is contained in:
Chen Ni 2026-03-12 11:18:20 +08:00 committed by Linus Walleij
parent fc334ad4a1
commit 9ba4ef6847

View 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;