mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Amitoj Kaur Chawla <amitoj1606@gmail.com>,
	<thierry.reding@gmail.com>, <airlied@linux.ie>,
	<swarren@wwwdotorg.org>, <gnurou@gmail.com>,
	<dri-devel@lists.freedesktop.org>, <linux-tegra@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <julia.lawall@lip6.fr>
Subject: Re: [PATCH v2] drm/tegra: dpaux: Modify error handling
Date: Mon, 15 Aug 2016 10:04:05 +0100	[thread overview]
Message-ID: <e2bf16fe-9ea7-6bd8-a027-0fa1bda79804@nvidia.com> (raw)
In-Reply-To: <20160815045748.GA12947@amitoj-Inspiron-3542>


On 15/08/16 05:57, Amitoj Kaur Chawla wrote:
> devm_pinctrl_register returns an ERR_PTR in case of error and should
> have an IS_ERR check instead of a null check.
> 
> The Coccinelle semantic patch used to make this change is as follows:
> @@
> expression e;
> @@
> 
>   e = devm_pinctrl_register(...);
> if(
> -    !e
> +    IS_ERR(e)
>     )
>     {
>   <+...
>   return
> - ...
> + PTR_ERR(e)
>   ;
>   ...+>
>   }
> 
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
> Changes in v2:
>         -Correct typo
> 
>  drivers/gpu/drm/tegra/dpaux.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c
> index 059f409..2fde44c 100644
> --- a/drivers/gpu/drm/tegra/dpaux.c
> +++ b/drivers/gpu/drm/tegra/dpaux.c
> @@ -539,9 +539,9 @@ static int tegra_dpaux_probe(struct platform_device *pdev)
>  	dpaux->desc.owner = THIS_MODULE;
>  
>  	dpaux->pinctrl = devm_pinctrl_register(&pdev->dev, &dpaux->desc, dpaux);
> -	if (!dpaux->pinctrl) {
> +	if (IS_ERR(dpaux->pinctrl)) {
>  		dev_err(&pdev->dev, "failed to register pincontrol\n");
> -		return -ENODEV;
> +		return PTR_ERR(dpaux->pinctrl);
>  	}
>  #endif
>  	/* enable and clear all interrupts */
> 

Acked-by: Jon Hunter <jonathanh@nvidia.com>

Cheers!
Jon

-- 
nvpublic

      reply	other threads:[~2016-08-15  9:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-15  4:57 Amitoj Kaur Chawla
2016-08-15  9:04 ` Jon Hunter [this message]

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=e2bf16fe-9ea7-6bd8-a027-0fa1bda79804@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=airlied@linux.ie \
    --cc=amitoj1606@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gnurou@gmail.com \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome