diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-12 13:51:04 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-12 13:51:04 -0500 |
commit | 06087cb42dc1da096c37f51ea12ad676f00569a9 (patch) | |
tree | 22408ce4ca111f74fec50994b7d38b89f33dd738 /drivers/usb/phy/phy.c | |
parent | 9c9d82492b73991e8e13a6c0af06e44816c31438 (diff) | |
parent | 5fb694f96e7c19e66b1c55124b98812e32e3efa5 (diff) |
Merge tag 'fixes-for-v3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus
Felipe writes:
usb: fixes for v3.19-rc5
Just three fixes this time. An oops fix in ep_write() from gadgetfs,
another oops for the Atmel UDC when unloading a gadget driver and
the fix for PHY deferred probing.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Conflicts:
drivers/usb/phy/phy.c
Diffstat (limited to 'drivers/usb/phy/phy.c')
-rw-r--r-- | drivers/usb/phy/phy.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index 353c686498d4..ccfdfb24b240 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c | |||
@@ -59,6 +59,9 @@ static struct usb_phy *__of_usb_find_phy(struct device_node *node) | |||
59 | { | 59 | { |
60 | struct usb_phy *phy; | 60 | struct usb_phy *phy; |
61 | 61 | ||
62 | if (!of_device_is_available(node)) | ||
63 | return ERR_PTR(-ENODEV); | ||
64 | |||
62 | list_for_each_entry(phy, &phy_list, head) { | 65 | list_for_each_entry(phy, &phy_list, head) { |
63 | if (node != phy->dev->of_node) | 66 | if (node != phy->dev->of_node) |
64 | continue; | 67 | continue; |
@@ -190,10 +193,13 @@ struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, | |||
190 | spin_lock_irqsave(&phy_lock, flags); | 193 | spin_lock_irqsave(&phy_lock, flags); |
191 | 194 | ||
192 | phy = __of_usb_find_phy(node); | 195 | phy = __of_usb_find_phy(node); |
193 | if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { | 196 | if (IS_ERR(phy)) { |
194 | if (!IS_ERR(phy)) | 197 | devres_free(ptr); |
195 | phy = ERR_PTR(-ENODEV); | 198 | goto err1; |
199 | } | ||
196 | 200 | ||
201 | if (!try_module_get(phy->dev->driver->owner)) { | ||
202 | phy = ERR_PTR(-ENODEV); | ||
197 | devres_free(ptr); | 203 | devres_free(ptr); |
198 | goto err1; | 204 | goto err1; |
199 | } | 205 | } |