linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Himangi Saraogi <himangi774@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-kernel@vger.kernel.org
Cc: julia.lawall@lip6.fr
Subject: Re: [PATCH] pinctrl: berlin: fix return value for dev_get_regmap
Date: Mon, 30 Jun 2014 11:34:29 +0200	[thread overview]
Message-ID: <53B12F25.5060908@gmail.com> (raw)
In-Reply-To: <20140629071815.GA16257@himangi-Dell>

On 06/29/2014 09:18 AM, Himangi Saraogi wrote:
> The failure value of dev_get_regmap is NULL. Hence, the return value is
> changed to -ENODEV.
>
> A simplified version of the semantic match that finds this problem is as
> follows:
>
> // <smpl>
> @@
> expression e1;
> @@
>
> * if (!e1)
>    return PTR_ERR(e1);
>
> // </smpl>
>
> Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
> Acked-by: Julia Lawall <julia.lawall@lip6.fr>

Himangi,

thanks for the fix, but we already have a similar patch [1] pending.

Sebastian

[1] http://www.spinics.net/lists/linux-kernel-janitors/msg19125.html

> ---
>   drivers/pinctrl/berlin/berlin.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
> index edf5d2f..86db223 100644
> --- a/drivers/pinctrl/berlin/berlin.c
> +++ b/drivers/pinctrl/berlin/berlin.c
> @@ -320,7 +320,7 @@ int berlin_pinctrl_probe(struct platform_device *pdev,
>
>   	regmap = dev_get_regmap(&pdev->dev, NULL);
>   	if (!regmap)
> -		return PTR_ERR(regmap);
> +		return -ENODEV;
>
>   	pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
>   	if (!pctrl)
>


      reply	other threads:[~2014-06-30  9:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-29  7:18 [PATCH] pinctrl: berlin: fix return value for dev_get_regmap Himangi Saraogi
2014-06-30  9:34 ` Sebastian Hesselbarth [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=53B12F25.5060908@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=himangi774@gmail.com \
    --cc=julia.lawall@lip6.fr \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.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).