[PATCH] drm: bridge: anx78xx: fix ptr_ret.cocci warnings

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

 




drivers/gpu/drm/bridge/anx78xx.c:632:1-3: WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

CC: Enric Balletbo i Serra <enric.balletbo@xxxxxxxxxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---

 anx78xx.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/gpu/drm/bridge/anx78xx.c
+++ b/drivers/gpu/drm/bridge/anx78xx.c
@@ -629,10 +629,7 @@ static int anx78xx_init_gpio(struct anx7
 
 	/* GPIO for V10 power control */
 	pdata->gpiod_v10 = devm_gpiod_get_optional(dev, "v10", GPIOD_OUT_LOW);
-	if (IS_ERR(pdata->gpiod_v10))
-		return PTR_ERR(pdata->gpiod_v10);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(pdata->gpiod_v10);
 }
 
 static int anx78xx_dp_link_training(struct anx78xx *anx78xx)
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux