From 138d876e30353da34495e463d20c9bd7c0fd4ba0 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 18 Mar 2014 10:58:33 +0100 Subject: 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 Cc: Mikael Pettersson Cc: Aaro Koskinen Signed-off-by: Bartlomiej Zolnierkiewicz Acked-by: Alexandre Courbot Acked-by: Dan Williams Signed-off-by: Linus Walleij --- drivers/gpio/gpio-iop.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/gpio') diff --git a/drivers/gpio/gpio-iop.c b/drivers/gpio/gpio-iop.c index c22a61be3a9c..0a5e9d3f308c 100644 --- a/drivers/gpio/gpio-iop.c +++ b/drivers/gpio/gpio-iop.c @@ -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); } -- cgit v1.2.3