Commit 31e322272d9d7da0724ae6e3180478575aa48909
Committed by
Felipe Balbi
1 parent
1b2e21b082
Exists in
master
and in
16 other branches
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>
Showing 5 changed files with 4 additions and 7 deletions Side-by-side Diff
drivers/usb/phy/phy-ab8500-usb.c
... | ... | @@ -1415,8 +1415,6 @@ |
1415 | 1415 | |
1416 | 1416 | platform_set_drvdata(pdev, ab); |
1417 | 1417 | |
1418 | - ATOMIC_INIT_NOTIFIER_HEAD(&ab->phy.notifier); | |
1419 | - | |
1420 | 1418 | /* all: Disable phy when called from set_host and set_peripheral */ |
1421 | 1419 | INIT_WORK(&ab->phy_dis_work, ab8500_usb_phy_disable_work); |
1422 | 1420 |
drivers/usb/phy/phy-generic.c
drivers/usb/phy/phy-gpio-vbus-usb.c
drivers/usb/phy/phy-mxs-usb.c
drivers/usb/phy/phy.c
... | ... | @@ -329,6 +329,8 @@ |
329 | 329 | return -EINVAL; |
330 | 330 | } |
331 | 331 | |
332 | + ATOMIC_INIT_NOTIFIER_HEAD(&x->notifier); | |
333 | + | |
332 | 334 | spin_lock_irqsave(&phy_lock, flags); |
333 | 335 | |
334 | 336 | list_for_each_entry(phy, &phy_list, head) { |
... | ... | @@ -366,6 +368,8 @@ |
366 | 368 | dev_err(x->dev, "no device provided for PHY\n"); |
367 | 369 | return -EINVAL; |
368 | 370 | } |
371 | + | |
372 | + ATOMIC_INIT_NOTIFIER_HEAD(&x->notifier); | |
369 | 373 | |
370 | 374 | spin_lock_irqsave(&phy_lock, flags); |
371 | 375 | list_for_each_entry(phy_bind, &phy_bind_list, list) |