diff options
| author | Linus Walleij <[email protected]> | 2015-01-20 10:03:07 +0000 |
|---|---|---|
| committer | Linus Walleij <[email protected]> | 2015-01-20 10:03:07 +0000 |
| commit | ee65ef609aa81539ac3792df88f04bfe29a77546 (patch) | |
| tree | 6816eaa3d45fa1078408f2ccfa5f88d32733d1d9 /drivers/usb/phy/phy.c | |
| parent | Documentation: gpio: Add APM X-Gene standby GPIO controller DTS binding (diff) | |
| parent | Linux 3.19-rc5 (diff) | |
| download | kernel-ee65ef609aa81539ac3792df88f04bfe29a77546.tar.gz kernel-ee65ef609aa81539ac3792df88f04bfe29a77546.zip | |
Merge tag 'v3.19-rc5' into devel
Linux 3.19-rc5
Diffstat (limited to 'drivers/usb/phy/phy.c')
| -rw-r--r-- | drivers/usb/phy/phy.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index b4066a001ba0..ccfdfb24b240 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -34,7 +34,7 @@ static struct usb_phy *__usb_find_phy(struct list_head *list, return phy; } - return ERR_PTR(-ENODEV); + return ERR_PTR(-EPROBE_DEFER); } static struct usb_phy *__usb_find_phy_dev(struct device *dev, @@ -59,6 +59,9 @@ static struct usb_phy *__of_usb_find_phy(struct device_node *node) { struct usb_phy *phy; + if (!of_device_is_available(node)) + return ERR_PTR(-ENODEV); + list_for_each_entry(phy, &phy_list, head) { if (node != phy->dev->of_node) continue; @@ -66,7 +69,7 @@ static struct usb_phy *__of_usb_find_phy(struct device_node *node) return phy; } - return ERR_PTR(-ENODEV); + return ERR_PTR(-EPROBE_DEFER); } static void devm_usb_phy_release(struct device *dev, void *res) @@ -190,10 +193,13 @@ struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, spin_lock_irqsave(&phy_lock, flags); phy = __of_usb_find_phy(node); - if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { - if (!IS_ERR(phy)) - phy = ERR_PTR(-EPROBE_DEFER); + if (IS_ERR(phy)) { + devres_free(ptr); + goto err1; + } + if (!try_module_get(phy->dev->driver->owner)) { + phy = ERR_PTR(-ENODEV); devres_free(ptr); goto err1; } |
