Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org, kbuild-all@01.org
Subject: [PATCH] regulator: lp8788-ldo: fix odd_ptr_err.cocci warnings
Date: Wed, 3 Jan 2018 07:19:46 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1801030718330.2597@hadrien> (raw)

From: Fengguang Wu <fengguang.wu@intel.com>

 PTR_ERR should normally access the value just tested by IS_ERR

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

Fixes: 460e9d2590fe ("regulator: lp8788-ldo: Pass descriptor instead of GPIO number")
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

Semantic patch information:
 There can be false positives in the patch case, where it is the call to
 IS_ERR that is wrong.

 lp8788-ldo.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/regulator/lp8788-ldo.c
+++ b/drivers/regulator/lp8788-ldo.c
@@ -507,7 +507,7 @@ static int lp8788_config_ldo_enable_mode
 						       enable_id,
 						       GPIOD_OUT_HIGH);
 	if (IS_ERR(ldo->ena_gpiod))
-		return PTR_ERR(ldo->ena->gpiod);
+		return PTR_ERR(ldo->ena_gpiod);

 	/* if no GPIO for ldo pin, then set default enable mode */
 	if (!ldo->ena_gpiod)

                 reply	other threads:[~2018-01-03  6:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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.20.1801030718330.2597@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=kbuild-all@01.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@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