linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] gpio: Fix return value check in xgene_gpio_probe()
@ 2014-09-11 23:12 weiyj_lk
  2014-09-19  8:40 ` Alexandre Courbot
  2014-09-24  8:05 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: weiyj_lk @ 2014-09-11 23:12 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot, Grant Likely, Rob Herring
  Cc: Wei Yongjun, linux-gpio

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function devm_ioremap_nocache() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/gpio/gpio-xgene.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c
index e25ba14..cf751f5 100644
--- a/drivers/gpio/gpio-xgene.c
+++ b/drivers/gpio/gpio-xgene.c
@@ -182,8 +182,8 @@ static int xgene_gpio_probe(struct platform_device *pdev)
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	gpio->base = devm_ioremap_nocache(&pdev->dev, res->start,
 							resource_size(res));
-	if (IS_ERR(gpio->base)) {
-		err = PTR_ERR(gpio->base);
+	if (!gpio->base) {
+		err = -ENOMEM;
 		goto err;
 	}
 


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

* Re: [PATCH -next] gpio: Fix return value check in xgene_gpio_probe()
  2014-09-11 23:12 [PATCH -next] gpio: Fix return value check in xgene_gpio_probe() weiyj_lk
@ 2014-09-19  8:40 ` Alexandre Courbot
  2014-09-24  8:05 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Courbot @ 2014-09-19  8:40 UTC (permalink / raw)
  To: weiyj_lk
  Cc: Linus Walleij, Grant Likely, Rob Herring, Wei Yongjun,
	linux-gpio@vger.kernel.org

On Fri, Sep 12, 2014 at 8:12 AM,  <weiyj_lk@163.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function devm_ioremap_nocache() returns NULL
> pointer not ERR_PTR(). The IS_ERR() test in the return value check
> should be replaced with NULL test.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>

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

* Re: [PATCH -next] gpio: Fix return value check in xgene_gpio_probe()
  2014-09-11 23:12 [PATCH -next] gpio: Fix return value check in xgene_gpio_probe() weiyj_lk
  2014-09-19  8:40 ` Alexandre Courbot
@ 2014-09-24  8:05 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2014-09-24  8:05 UTC (permalink / raw)
  To: weiyj_lk
  Cc: Alexandre Courbot, Grant Likely, Rob Herring, Wei Yongjun,
	linux-gpio@vger.kernel.org

On Fri, Sep 12, 2014 at 1:12 AM,  <weiyj_lk@163.com> wrote:

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function devm_ioremap_nocache() returns NULL
> pointer not ERR_PTR(). The IS_ERR() test in the return value check
> should be replaced with NULL test.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Patch applied with Alex's Review tag.

Yours,
Linus Walleij

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

end of thread, other threads:[~2014-09-24  8:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-11 23:12 [PATCH -next] gpio: Fix return value check in xgene_gpio_probe() weiyj_lk
2014-09-19  8:40 ` Alexandre Courbot
2014-09-24  8:05 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).