linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: manivannan.sadhasivam@linaro.org (Manivannan Sadhasivam)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH -next] gpio: Fix return value check in owl_gpio_probe()
Date: Mon, 7 May 2018 08:52:34 +0530	[thread overview]
Message-ID: <20180507032233.wwi2nib5x2stpsyg@linaro.org> (raw)
In-Reply-To: <1525657224-88189-1-git-send-email-weiyongjun1@huawei.com>

Hi Wei,

Thanks for the patch.

On Mon, May 07, 2018 at 01:40:24AM +0000, Wei Yongjun wrote:
> 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;
> 

Agree with the check here. But the return value should be -ENXIO?

Regards,
Mani

>  	/*
>  	 * Get the number of gpio's for this bank. If none specified,
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2018-05-07  3:22 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 [this message]
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

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=20180507032233.wwi2nib5x2stpsyg@linaro.org \
    --to=manivannan.sadhasivam@linaro.org \
    --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).