summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2025-03-10 13:52:05 +0300
committerLinus Walleij <linus.walleij@linaro.org>2025-03-17 14:24:45 +0100
commit465cf6767198817870c8da5659d4d309847ea954 (patch)
treefa4f756fea3931bc787b958a8e6134a96a636728
parent4cc1b5ce232e65eb4bc8435949d2ce4ab23764b4 (diff)
pinctrl: amd: isp411: Fix IS_ERR() vs NULL check in probe()
The platform_get_resource() returns NULL on error. It doesn't return error pointers. Fix the error checking to match. Fixes: e97435ab09f3 ("pinctrl: amd: isp411: Add amdisp GPIO pinctrl") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Pratap Nirujogi <pratap.nirujogi@amd.com> Link: https://lore.kernel.org/617f4c77-7837-4e24-9f4d-620ecfedf924@stanley.mountain Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/pinctrl-amdisp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-amdisp.c b/drivers/pinctrl/pinctrl-amdisp.c
index ce21ed84b929..9256ed67bb20 100644
--- a/drivers/pinctrl/pinctrl-amdisp.c
+++ b/drivers/pinctrl/pinctrl-amdisp.c
@@ -183,8 +183,8 @@ static int amdisp_pinctrl_probe(struct platform_device *pdev)
pdev->dev.init_name = DRV_NAME;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (IS_ERR(res))
- return PTR_ERR(res);
+ if (!res)
+ return -EINVAL;
pctrl->gpiobase = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(pctrl->gpiobase))