All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Nilsson <jesper.nilsson@axis.com>
To: Wei Yongjun <weiyj.lk@gmail.com>
Cc: Jesper Nilsson <jespern@axis.com>, Lars Persson <larper@axis.com>,
	Niklas Cassel <niklass@axis.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	linux-arm-kernel@axis.com, linux-gpio@vger.kernel.org
Subject: Re: [PATCH -next] pinctrl: artpec6: Fix return value check in artpec6_pmx_probe()
Date: Tue, 25 Apr 2017 10:31:20 +0200	[thread overview]
Message-ID: <20170425083120.GI18509@axis.com> (raw)
In-Reply-To: <20170425032945.22157-1-weiyj.lk@gmail.com>

On Tue, Apr 25, 2017 at 03:29:45AM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> In case of error, the function pinctrl_register() returns
> NULL not ERR_PTR(). The IS_ERR() test in the return value
> check should be replaced with NULL test.

Uh, the comment above reads as the exact opposite
of what the patch does. Your point is valid though,
but the comment needs rephrasing.

> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

/Jesper

> ---
>  drivers/pinctrl/pinctrl-artpec6.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
> index b5a2eff..6a16019 100644
> --- a/drivers/pinctrl/pinctrl-artpec6.c
> +++ b/drivers/pinctrl/pinctrl-artpec6.c
> @@ -938,9 +938,9 @@ static int artpec6_pmx_probe(struct platform_device *pdev)
>  	pmx->num_pin_groups = ARRAY_SIZE(artpec6_pin_groups);
>  	pmx->pctl	    = pinctrl_register(&artpec6_desc, &pdev->dev, pmx);
>  
> -	if (!pmx->pctl) {
> +	if (IS_ERR(pmx->pctl)) {
>  		dev_err(&pdev->dev, "could not register pinctrl driver\n");
> -		return -EINVAL;
> +		return PTR_ERR(pmx->pctl);
>  	}
>  
>  	platform_set_drvdata(pdev, pmx);

/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@axis.com

  reply	other threads:[~2017-04-25  8:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25  3:29 [PATCH -next] pinctrl: artpec6: Fix return value check in artpec6_pmx_probe() Wei Yongjun
2017-04-25  8:31 ` Jesper Nilsson [this message]
2017-04-25  9:18   ` weiyongjun (A)
2017-04-25 11:29 ` [PATCH -next v2] " Wei Yongjun
2017-04-25 13:40   ` Jesper Nilsson
2017-04-28  7:43     ` Linus Walleij
2017-04-28  7:58       ` Jesper Nilsson
2017-04-28 14:26         ` Tony Lindgren
2017-04-28  7:41   ` 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=20170425083120.GI18509@axis.com \
    --to=jesper.nilsson@axis.com \
    --cc=jespern@axis.com \
    --cc=larper@axis.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@axis.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=niklass@axis.com \
    --cc=weiyj.lk@gmail.com \
    --cc=weiyongjun1@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.