Skip to content

Commit 465cf67

Browse files
Dan Carpenterlinusw
authored andcommitted
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: 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>
1 parent 4cc1b5c commit 465cf67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pinctrl/pinctrl-amdisp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ static int amdisp_pinctrl_probe(struct platform_device *pdev)
183183
pdev->dev.init_name = DRV_NAME;
184184

185185
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
186-
if (IS_ERR(res))
187-
return PTR_ERR(res);
186+
if (!res)
187+
return -EINVAL;
188188

189189
pctrl->gpiobase = devm_ioremap_resource(&pdev->dev, res);
190190
if (IS_ERR(pctrl->gpiobase))

0 commit comments

Comments
 (0)