mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
gpio: iop: fix devm_ioremap_resource() return value checking
devm_ioremap_resource() returns a pointer to the remapped memory or an ERR_PTR() encoded error code on failure. Fix the check inside iop3xx_gpio_probe() accordingly. Cc: Lennert Buytenhek <kernel@wantstofly.org> Cc: Mikael Pettersson <mikpe@it.uu.se> Cc: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Acked-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
523dcce72c
commit
138d876e30
@ -111,6 +111,8 @@ static int iop3xx_gpio_probe(struct platform_device *pdev)
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(base))
|
||||
return PTR_ERR(base);
|
||||
|
||||
return gpiochip_add(&iop3xx_chip);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user