mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Cc: 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
Subject: Re: [PATCH] drm/tegra: dpaux: Modify error handling
Date: Sat, 13 Aug 2016 10:00:19 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1608130959510.3344@hadrien> (raw)
In-Reply-To: <20160813040020.GA11719@amitoj-Inspiron-3542>



On Sat, 13 Aug 2016, 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_pinxtrl_register(...);

Actually, there is a typo here.  devm_pinxtrl_register should be
devm_pinctrl_register.

julia

> if(
> -    !e
> +    IS_ERR(e)
>     )
>     {
>   <+...
>   return
> - ...
> + PTR_ERR(e)
>   ;
>   ...+>
>   }
>
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
>  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 */
> --
> 1.9.1
>
>

      reply	other threads:[~2016-08-13  8:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-13  4:00 Amitoj Kaur Chawla
2016-08-13  8:00 ` Julia Lawall [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=alpine.DEB.2.10.1608130959510.3344@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=airlied@linux.ie \
    --cc=amitoj1606@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gnurou@gmail.com \
    --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

all inboxes | Powered by JetHome®