aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/phy/phy.c')
-rw-r--r--drivers/usb/phy/phy.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
index 1b74523e1fee..8afa813d690b 100644
--- a/drivers/usb/phy/phy.c
+++ b/drivers/usb/phy/phy.c
@@ -130,7 +130,7 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type)
130 130
131 phy = __usb_find_phy(&phy_list, type); 131 phy = __usb_find_phy(&phy_list, type);
132 if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { 132 if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
133 pr_err("unable to find transceiver of type %s\n", 133 pr_debug("PHY: unable to find transceiver of type %s\n",
134 usb_phy_type_string(type)); 134 usb_phy_type_string(type));
135 goto err0; 135 goto err0;
136 } 136 }
@@ -228,7 +228,7 @@ struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
228 228
229 phy = __usb_find_phy_dev(dev, &phy_bind_list, index); 229 phy = __usb_find_phy_dev(dev, &phy_bind_list, index);
230 if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { 230 if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
231 pr_err("unable to find transceiver\n"); 231 dev_dbg(dev, "unable to find transceiver\n");
232 goto err0; 232 goto err0;
233 } 233 }
234 234
@@ -329,6 +329,8 @@ int usb_add_phy(struct usb_phy *x, enum usb_phy_type type)
329 return -EINVAL; 329 return -EINVAL;
330 } 330 }
331 331
332 ATOMIC_INIT_NOTIFIER_HEAD(&x->notifier);
333
332 spin_lock_irqsave(&phy_lock, flags); 334 spin_lock_irqsave(&phy_lock, flags);
333 335
334 list_for_each_entry(phy, &phy_list, head) { 336 list_for_each_entry(phy, &phy_list, head) {
@@ -367,6 +369,8 @@ int usb_add_phy_dev(struct usb_phy *x)
367 return -EINVAL; 369 return -EINVAL;
368 } 370 }
369 371
372 ATOMIC_INIT_NOTIFIER_HEAD(&x->notifier);
373
370 spin_lock_irqsave(&phy_lock, flags); 374 spin_lock_irqsave(&phy_lock, flags);
371 list_for_each_entry(phy_bind, &phy_bind_list, list) 375 list_for_each_entry(phy_bind, &phy_bind_list, list)
372 if (!(strcmp(phy_bind->phy_dev_name, dev_name(x->dev)))) 376 if (!(strcmp(phy_bind->phy_dev_name, dev_name(x->dev))))
@@ -420,10 +424,8 @@ int usb_bind_phy(const char *dev_name, u8 index,
420 unsigned long flags; 424 unsigned long flags;
421 425
422 phy_bind = kzalloc(sizeof(*phy_bind), GFP_KERNEL); 426 phy_bind = kzalloc(sizeof(*phy_bind), GFP_KERNEL);
423 if (!phy_bind) { 427 if (!phy_bind)
424 pr_err("phy_bind(): No memory for phy_bind");
425 return -ENOMEM; 428 return -ENOMEM;
426 }
427 429
428 phy_bind->dev_name = dev_name; 430 phy_bind->dev_name = dev_name;
429 phy_bind->phy_dev_name = phy_dev_name; 431 phy_bind->phy_dev_name = phy_dev_name;