[PATCH 01/11] usb: phy: return error on failure

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

 



If the requested phy operation can't be done, return error instead of
success to let the caller know.

Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@xxxxxxxxx>
---
 include/linux/usb/phy.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index bc91b5d..d2b03db 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -262,7 +262,7 @@ usb_phy_set_power(struct usb_phy *x, unsigned mA)
 {
 	if (x && x->set_power)
 		return x->set_power(x, mA);
-	return 0;
+	return -EOPNOTSUPP;
 }
 
 /* Context: can sleep */
@@ -272,7 +272,7 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend)
 	if (x && x->set_suspend != NULL)
 		return x->set_suspend(x, suspend);
 	else
-		return 0;
+		return -EOPNOTSUPP;
 }
 
 static inline int
@@ -281,7 +281,7 @@ usb_phy_set_wakeup(struct usb_phy *x, bool enabled)
 	if (x && x->set_wakeup)
 		return x->set_wakeup(x, enabled);
 	else
-		return 0;
+		return -EOPNOTSUPP;
 }
 
 static inline int
@@ -290,7 +290,7 @@ usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
 	if (x && x->notify_connect)
 		return x->notify_connect(x, speed);
 	else
-		return 0;
+		return -EOPNOTSUPP;
 }
 
 static inline int
@@ -299,7 +299,7 @@ usb_phy_notify_disconnect(struct usb_phy *x, enum usb_device_speed speed)
 	if (x && x->notify_disconnect)
 		return x->notify_disconnect(x, speed);
 	else
-		return 0;
+		return -EOPNOTSUPP;
 }
 
 /* notifiers */
-- 
2.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux