From: weiyongjun1@huawei.com (Wei Yongjun)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH -next v2] gpio: owl: Fix return value check in owl_gpio_probe()
Date: Mon, 7 May 2018 06:25:56 +0000 [thread overview]
Message-ID: <1525674356-39189-1-git-send-email-weiyongjun1@huawei.com> (raw)
In-Reply-To: <1525657224-88189-1-git-send-email-weiyongjun1@huawei.com>
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>
---
v1 -> v2: return -ENXIO instead of -ENOMEM
---
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 -ENXIO;
/*
* Get the number of gpio's for this bank. If none specified,
next prev parent reply other threads:[~2018-05-07 6:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Wei Yongjun [this message]
2018-05-07 6:21 ` [PATCH -next v2] gpio: owl: " Manivannan Sadhasivam
2018-05-16 12:55 ` [PATCH -next] gpio: " Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1525674356-39189-1-git-send-email-weiyongjun1@huawei.com \
--to=weiyongjun1@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).