lkml.org 
[lkml]   [2014]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] gpio: iop: fix devm_ioremap_resource() return value checking
Date
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);
}


\
 
 \ /
  Last update: 2014-03-18 11:21    [W:0.063 / U:10.004 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site