From: Chen Ni Date: Thu, 12 Mar 2026 03:18:20 +0000 (+0800) Subject: pinctrl: realtek: Fix error check for devm_platform_ioremap_resource() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ba4ef6847ba53dea92efce47c9e044fbf6d6dcf;p=thirdparty%2Flinux.git 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 Signed-off-by: Linus Walleij --- 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;