diff options
author | Neil Zhang <zhangwm@marvell.com> | 2013-12-11 01:45:14 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-12-12 14:43:34 -0500 |
commit | 31e322272d9d7da0724ae6e3180478575aa48909 (patch) | |
tree | d060afe182c78e1c139d3cc158150ab40c351f9f /drivers/usb/phy/phy.c | |
parent | 1b2e21b082a1c67cd7861bd86c4a46a3f0f348ea (diff) |
usb: phy: initialize the notifier when add a new phy
We need to initialize the notifer before use it.
So lets initialize it when add a new phy device to
reduce the code redundancy.
Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy/phy.c')
-rw-r--r-- | drivers/usb/phy/phy.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index 1b74523e1fee..e6f61e4361df 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c | |||
@@ -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)))) |