Skip to content

Commit

Permalink
pinctrl: amd: isp411: Fix IS_ERR() vs NULL check in probe()
Browse files Browse the repository at this point in the history
The platform_get_resource() returns NULL on error.  It doesn't
return error pointers.  Fix the error checking to match.

Fixes: e97435a ("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>
  • Loading branch information
Dan Carpenter authored and Linus Walleij committed Mar 17, 2025
1 parent 4cc1b5c commit 465cf67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pinctrl/pinctrl-amdisp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 465cf67

Please sign in to comment.