Skip to contentSkip to conversation

Staging: usb: Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR.

PATCH New Sandhya Bankar 1 participant 1 message Feb 27, 2016 USB

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 Staging: usb: Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR.

Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR.

---
changes in v2 :
* Add missing return.

 drivers/usb/phy/phy-qcom-8x16-usb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/usb/phy/phy-qcom-8x16-usb.c +1 -3
index 579587d..9724997 100644
@@ -291,10 +291,8 @@ static int phy_8x16_read_devicetree(struct phy_8x16 *qphy)
 
 	qphy->switch_gpio = devm_gpiod_get_optional(dev, "switch",
 						   GPIOD_OUT_LOW);
-	if (IS_ERR(qphy->switch_gpio))
-		return PTR_ERR(qphy->switch_gpio);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(qphy->switch_gpio);
 }
 
 static int phy_8x16_reboot_notify(struct notifier_block *this,
Signature · 1 line
1.8.3.4