[PATCH] regulator: lp8788-ldo: fix odd_ptr_err.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Fengguang Wu <fengguang.wu@xxxxxxxxx>

 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@xxxxxxxxx>
Signed-off-by: Julia Lawall <julia.lawall@xxxxxxx>
---

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)
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux