linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] gpio: Fix return value check in owl_gpio_probe()
@ 2018-05-07  1:40 Wei Yongjun
  2018-05-07  3:22 ` Manivannan Sadhasivam
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Wei Yongjun @ 2018-05-07  1:40 UTC (permalink / raw)
  To: linux-arm-kernel

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

Fixes: d3654d38809c ("gpio: Add gpio driver for Actions OWL S900 SoC")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/gpio/gpio-owl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-owl.c b/drivers/gpio/gpio-owl.c
index 3546362..f35e80f 100644
--- a/drivers/gpio/gpio-owl.c
+++ b/drivers/gpio/gpio-owl.c
@@ -128,8 +128,8 @@ static int owl_gpio_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	gpio->base = of_iomap(dev->of_node, 0);
-	if (IS_ERR(gpio->base))
-		return PTR_ERR(gpio->base);
+	if (!gpio->base)
+		return -ENOMEM;
 
 	/*
 	 * Get the number of gpio's for this bank. If none specified,

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

end of thread, other threads:[~2018-05-16 12:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-07  1:40 [PATCH -next] gpio: Fix return value check in owl_gpio_probe() Wei Yongjun
2018-05-07  3:22 ` Manivannan Sadhasivam
2018-05-07  6:25 ` [PATCH -next v2] gpio: owl: " Wei Yongjun
2018-05-07  6:21   ` Manivannan Sadhasivam
2018-05-16 12:55 ` [PATCH -next] gpio: " 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).