The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] gpio: iop: fix devm_ioremap_resource() return value checking
@ 2014-03-18  9:58 Bartlomiej Zolnierkiewicz
  2014-03-19  1:57 ` Alexandre Courbot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2014-03-18  9:58 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: Lennert Buytenhek, Dan Williams, Mikael Pettersson, Aaro Koskinen,
	linux-gpio, linux-kernel

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: Dan Williams <dan.j.williams@intel.com>
Cc: Mikael Pettersson <mikpe@it.uu.se>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
Compile tested only.

 drivers/gpio/gpio-iop.c |    2 ++
 1 file changed, 2 insertions(+)

Index: b/drivers/gpio/gpio-iop.c
===================================================================
--- a/drivers/gpio/gpio-iop.c	2014-03-14 16:45:08.152724313 +0100
+++ b/drivers/gpio/gpio-iop.c	2014-03-18 10:50:01.903194680 +0100
@@ -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);
 }


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-25 14:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-18  9:58 [PATCH] gpio: iop: fix devm_ioremap_resource() return value checking Bartlomiej Zolnierkiewicz
2014-03-19  1:57 ` Alexandre Courbot
2014-03-19 16:58 ` Dan Williams
2014-03-25 14:04 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox