]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pinctrl: amd: isp411: Fix IS_ERR() vs NULL check in probe()
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 10 Mar 2025 10:52:05 +0000 (13:52 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 17 Mar 2025 13:24:45 +0000 (14:24 +0100)
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>
drivers/pinctrl/pinctrl-amdisp.c

index ce21ed84b9295034eb3e194b456245dbc46d19ad..9256ed67bb20e9eefef6c6574f1b60d71814cdc0 100644 (file)
@@ -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))