Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361247
b: refs/heads/master
c: 1dd03d8
h: refs/heads/master
i:
  361245: 1d7c207
  361243: ed99ab8
  361239: a1993b5
  361231: 9e877a5
  361215: 137c05c
v: v3
  • Loading branch information
Marc Kleine-Budde authored and Felipe Balbi committed Mar 4, 2013
1 parent 92d1a1f commit 689fbb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a10840c9acbeca7aada3543823fdb59909342d96
refs/heads/master: 1dd03d8a510dae402096b194385a1373100450dc
10 changes: 7 additions & 3 deletions trunk/drivers/usb/otg/otg.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type)
spin_lock_irqsave(&phy_lock, flags);

phy = __usb_find_phy(&phy_list, type);
if (IS_ERR(phy)) {
if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
pr_err("unable to find transceiver of type %s\n",
usb_phy_type_string(type));
goto err0;
Expand Down Expand Up @@ -228,7 +228,7 @@ struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
spin_lock_irqsave(&phy_lock, flags);

phy = __usb_find_phy_dev(dev, &phy_bind_list, index);
if (IS_ERR(phy)) {
if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
pr_err("unable to find transceiver\n");
goto err0;
}
Expand Down Expand Up @@ -301,8 +301,12 @@ EXPORT_SYMBOL(devm_usb_put_phy);
*/
void usb_put_phy(struct usb_phy *x)
{
if (x)
if (x) {
struct module *owner = x->dev->driver->owner;

put_device(x->dev);
module_put(owner);
}
}
EXPORT_SYMBOL(usb_put_phy);

Expand Down

0 comments on commit 689fbb4

Please sign in to comment.