summaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy.c
diff options
context:
space:
mode:
authorNeil Zhang <zhangwm@marvell.com>2013-12-11 07:45:14 +0100
committerFelipe Balbi <balbi@ti.com>2013-12-12 20:43:34 +0100
commit31e322272d9d7da0724ae6e3180478575aa48909 (patch)
treed060afe182c78e1c139d3cc158150ab40c351f9f /drivers/usb/phy/phy.c
parentusb: renesas_usbhs: fifo: request DMAEngine once (diff)
downloadlinux-31e322272d9d7da0724ae6e3180478575aa48909.tar.xz
linux-31e322272d9d7da0724ae6e3180478575aa48909.zip
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.c4
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)
return -EINVAL;
}
+ ATOMIC_INIT_NOTIFIER_HEAD(&x->notifier);
+
spin_lock_irqsave(&phy_lock, flags);
list_for_each_entry(phy, &phy_list, head) {
@@ -367,6 +369,8 @@ int usb_add_phy_dev(struct usb_phy *x)
return -EINVAL;
}
+ ATOMIC_INIT_NOTIFIER_HEAD(&x->notifier);
+
spin_lock_irqsave(&phy_lock, flags);
list_for_each_entry(phy_bind, &phy_bind_list, list)
if (!(strcmp(phy_bind->phy_dev_name, dev_name(x->dev))))