summaryrefslogtreecommitdiffstats
path: root/drivers/phy/phy-twl4030-usb.c
diff options
context:
space:
mode:
authorKishon Vijay Abraham I <kishon@ti.com>2014-02-17 14:29:25 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-18 12:13:16 -0800
commit64fe1891696cdef4603b5f2d7c3a846bce8cf42b (patch)
tree93b9f7f93fa20d351f1a09c847b1e275cfff23a6 /drivers/phy/phy-twl4030-usb.c
parentb51fbf9fb0c32c1a98f824ab5d6f59b17b39ef9e (diff)
downloadtalos-obmc-linux-64fe1891696cdef4603b5f2d7c3a846bce8cf42b.tar.gz
talos-obmc-linux-64fe1891696cdef4603b5f2d7c3a846bce8cf42b.zip
phy: let phy_provider_register be the last step in registering PHY
Registering phy_provider before creating the PHY can result in PHY callbacks being invoked which will lead to aborts. In order to avoid this invoke phy_provider_register after phy_create and phy_set_drvdata. Reported-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/phy/phy-twl4030-usb.c')
-rw-r--r--drivers/phy/phy-twl4030-usb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index daf65e68aaab..c3ace1db8136 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -695,11 +695,6 @@ static int twl4030_usb_probe(struct platform_device *pdev)
otg->set_host = twl4030_set_host;
otg->set_peripheral = twl4030_set_peripheral;
- phy_provider = devm_of_phy_provider_register(twl->dev,
- of_phy_simple_xlate);
- if (IS_ERR(phy_provider))
- return PTR_ERR(phy_provider);
-
phy = devm_phy_create(twl->dev, &ops, init_data);
if (IS_ERR(phy)) {
dev_dbg(&pdev->dev, "Failed to create PHY\n");
@@ -708,6 +703,11 @@ static int twl4030_usb_probe(struct platform_device *pdev)
phy_set_drvdata(phy, twl);
+ phy_provider = devm_of_phy_provider_register(twl->dev,
+ of_phy_simple_xlate);
+ if (IS_ERR(phy_provider))
+ return PTR_ERR(phy_provider);
+
/* init spinlock for workqueue */
spin_lock_init(&twl->lock);
OpenPOWER on IntegriCloud