aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy
diff options
context:
space:
mode:
authorNeil Zhang <zhangwm@marvell.com>2013-12-11 01:45:14 -0500
committerFelipe Balbi <balbi@ti.com>2013-12-12 14:43:34 -0500
commit31e322272d9d7da0724ae6e3180478575aa48909 (patch)
treed060afe182c78e1c139d3cc158150ab40c351f9f /drivers/usb/phy
parent1b2e21b082a1c67cd7861bd86c4a46a3f0f348ea (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')
-rw-r--r--drivers/usb/phy/phy-ab8500-usb.c2
-rw-r--r--drivers/usb/phy/phy-generic.c1
-rw-r--r--drivers/usb/phy/phy-gpio-vbus-usb.c2
-rw-r--r--drivers/usb/phy/phy-mxs-usb.c2
-rw-r--r--drivers/usb/phy/phy.c4
5 files changed, 4 insertions, 7 deletions
diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c
index 087402350b6d..11ab2c45e462 100644
--- a/drivers/usb/phy/phy-ab8500-usb.c
+++ b/drivers/usb/phy/phy-ab8500-usb.c
@@ -1415,8 +1415,6 @@ static int ab8500_usb_probe(struct platform_device *pdev)
1415 1415
1416 platform_set_drvdata(pdev, ab); 1416 platform_set_drvdata(pdev, ab);
1417 1417
1418 ATOMIC_INIT_NOTIFIER_HEAD(&ab->phy.notifier);
1419
1420 /* all: Disable phy when called from set_host and set_peripheral */ 1418 /* all: Disable phy when called from set_host and set_peripheral */
1421 INIT_WORK(&ab->phy_dis_work, ab8500_usb_phy_disable_work); 1419 INIT_WORK(&ab->phy_dis_work, ab8500_usb_phy_disable_work);
1422 1420
diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
index fce3a9e9bb5d..cd19bbc6e3cd 100644
--- a/drivers/usb/phy/phy-generic.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -210,7 +210,6 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_gen_xceiv *nop,
210 nop->phy.otg->set_host = nop_set_host; 210 nop->phy.otg->set_host = nop_set_host;
211 nop->phy.otg->set_peripheral = nop_set_peripheral; 211 nop->phy.otg->set_peripheral = nop_set_peripheral;
212 212
213 ATOMIC_INIT_NOTIFIER_HEAD(&nop->phy.notifier);
214 return 0; 213 return 0;
215} 214}
216EXPORT_SYMBOL_GPL(usb_phy_gen_create_phy); 215EXPORT_SYMBOL_GPL(usb_phy_gen_create_phy);
diff --git a/drivers/usb/phy/phy-gpio-vbus-usb.c b/drivers/usb/phy/phy-gpio-vbus-usb.c
index 02799a5efcd4..69462e09d014 100644
--- a/drivers/usb/phy/phy-gpio-vbus-usb.c
+++ b/drivers/usb/phy/phy-gpio-vbus-usb.c
@@ -314,8 +314,6 @@ static int gpio_vbus_probe(struct platform_device *pdev)
314 goto err_irq; 314 goto err_irq;
315 } 315 }
316 316
317 ATOMIC_INIT_NOTIFIER_HEAD(&gpio_vbus->phy.notifier);
318
319 INIT_DELAYED_WORK(&gpio_vbus->work, gpio_vbus_work); 317 INIT_DELAYED_WORK(&gpio_vbus->work, gpio_vbus_work);
320 318
321 gpio_vbus->vbus_draw = regulator_get(&pdev->dev, "vbus_draw"); 319 gpio_vbus->vbus_draw = regulator_get(&pdev->dev, "vbus_draw");
diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index 797c45b9ddab..fa44c0f3e861 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -167,8 +167,6 @@ static int mxs_phy_probe(struct platform_device *pdev)
167 mxs_phy->phy.notify_disconnect = mxs_phy_on_disconnect; 167 mxs_phy->phy.notify_disconnect = mxs_phy_on_disconnect;
168 mxs_phy->phy.type = USB_PHY_TYPE_USB2; 168 mxs_phy->phy.type = USB_PHY_TYPE_USB2;
169 169
170 ATOMIC_INIT_NOTIFIER_HEAD(&mxs_phy->phy.notifier);
171
172 mxs_phy->clk = clk; 170 mxs_phy->clk = clk;
173 171
174 platform_set_drvdata(pdev, &mxs_phy->phy); 172 platform_set_drvdata(pdev, &mxs_phy->phy);
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))))