diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-01-31 12:19:29 +0100 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-02-28 11:36:45 +0100 |
commit | f5678b135967ea98256ee5df9a360b5769861d23 (patch) | |
tree | 18336c841d3a0e40bea5886d9e7338199dc3a53f | |
parent | b523f916712e629aa9b4978869fa9d0ae5402828 (diff) | |
download | linux-f5678b135967ea98256ee5df9a360b5769861d23.tar.gz linux-f5678b135967ea98256ee5df9a360b5769861d23.tar.xz |
USB mxs-phy: Register phy with framework
We now have usb_add_phy_dev(), so use it to register with the framework
to be able to find the phy from the USB driver.
Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r-- | drivers/usb/otg/mxs-phy.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c index dff10f206352..9d4381e64d51 100644 --- a/drivers/usb/otg/mxs-phy.c +++ b/drivers/usb/otg/mxs-phy.c @@ -127,6 +127,7 @@ static int mxs_phy_probe(struct platform_device *pdev) void __iomem *base; struct clk *clk; struct mxs_phy *mxs_phy; + int ret; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { @@ -166,11 +167,19 @@ static int mxs_phy_probe(struct platform_device *pdev) platform_set_drvdata(pdev, &mxs_phy->phy); + ret = usb_add_phy_dev(&mxs_phy->phy); + if (ret) + return ret; + return 0; } static int mxs_phy_remove(struct platform_device *pdev) { + struct mxs_phy *mxs_phy = platform_get_drvdata(pdev); + + usb_remove_phy(&mxs_phy->phy); + platform_set_drvdata(pdev, NULL); return 0; |