Skip to contentSkip to conversation

gpio: iop: fix devm_ioremap_resource() return value checking

PATCH In review Bartlomiej Zolnierkiewicz 4 participants 4 messages Mar 18, 2014 – Mar 25, 2014 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 <[email protected]>
Cc Dan Williams <[email protected]>
Cc Mikael Pettersson <[email protected]>
Cc Aaro Koskinen <[email protected]>

---
Compile tested only.

 drivers/gpio/gpio-iop.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpio/gpio-iop.c +2 -0
Index: b/drivers/gpio/gpio-iop.c
===================================================================
@@ -111,6 +111,8 @@ static int iop3xx_gpio_probe(struct plat
 
 	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);
 }
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Bartlomiej Zolnierkiewicz

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.

Acked-by on v1 1/1
#2 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 9 lines · Bartlomiej Zolnierkiewicz

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 <[email protected]>
Cc Dan Williams <[email protected]>
Cc Mikael Pettersson <[email protected]>
Cc Aaro Koskinen <[email protected]>
#3 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 9 lines · Bartlomiej Zolnierkiewicz

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 <[email protected]>
Cc Dan Williams <[email protected]>
Cc Mikael Pettersson <[email protected]>
Cc Aaro Koskinen <[email protected]>

Patch applied with ACKs.

Yours,
Linus Walleij