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>
This commit is contained in:
parent
3bf6db9bbe
commit
b7fa5c2aec
|
@ -197,29 +197,29 @@ extern int usb_bind_phy(const char *dev_name, u8 index,
|
||||||
#else
|
#else
|
||||||
static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
|
static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
|
||||||
{
|
{
|
||||||
return NULL;
|
return ERR_PTR(-ENXIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct usb_phy *devm_usb_get_phy(struct device *dev,
|
static inline struct usb_phy *devm_usb_get_phy(struct device *dev,
|
||||||
enum usb_phy_type type)
|
enum usb_phy_type type)
|
||||||
{
|
{
|
||||||
return NULL;
|
return ERR_PTR(-ENXIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
|
static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
|
||||||
{
|
{
|
||||||
return NULL;
|
return ERR_PTR(-ENXIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index)
|
static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index)
|
||||||
{
|
{
|
||||||
return NULL;
|
return ERR_PTR(-ENXIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
|
static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
|
||||||
const char *phandle, u8 index)
|
const char *phandle, u8 index)
|
||||||
{
|
{
|
||||||
return NULL;
|
return ERR_PTR(-ENXIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void usb_put_phy(struct usb_phy *x)
|
static inline void usb_put_phy(struct usb_phy *x)
|
||||||
|
|
Loading…
Reference in a new issue