aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2013-03-14 11:59:06 -0400
committerFelipe Balbi <balbi@ti.com>2013-03-18 05:18:26 -0400
commitb7fa5c2aec5be083eb2719b405089703608e9bc6 (patch)
tree9a25ce9c81a5f5ec974ffd69482a98dca4694637
parent3bf6db9bbe4ad7b08b714c1857a703c1ef1b1e83 (diff)
usb: phy: return -ENXIO when PHY layer isn't enabled
in cases where PHY layer isn't enabled, we want to still return an error code (actually an error pointer) so that our users don't need to cope with either error pointer of NULL. This will simplify users as below: - return IS_ERR(phy) ? PTR_ERR(phy) : -ENODEV; + return PTR_ERR(phy); Acked-by: Kishon Vijay Abraham I <kishon@ti.com> Reported-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--include/linux/usb/phy.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index b7c2217c585f..6b5978f57633 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -197,29 +197,29 @@ extern int usb_bind_phy(const char *dev_name, u8 index,
197#else 197#else
198static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) 198static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
199{ 199{
200 return NULL; 200 return ERR_PTR(-ENXIO);
201} 201}
202 202
203static inline struct usb_phy *devm_usb_get_phy(struct device *dev, 203static inline struct usb_phy *devm_usb_get_phy(struct device *dev,
204 enum usb_phy_type type) 204 enum usb_phy_type type)
205{ 205{
206 return NULL; 206 return ERR_PTR(-ENXIO);
207} 207}
208 208
209static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index) 209static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
210{ 210{
211 return NULL; 211 return ERR_PTR(-ENXIO);
212} 212}
213 213
214static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index) 214static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index)
215{ 215{
216 return NULL; 216 return ERR_PTR(-ENXIO);
217} 217}
218 218
219static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, 219static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
220 const char *phandle, u8 index) 220 const char *phandle, u8 index)
221{ 221{
222 return NULL; 222 return ERR_PTR(-ENXIO);
223} 223}
224 224
225static inline void usb_put_phy(struct usb_phy *x) 225static inline void usb_put_phy(struct usb_phy *x)