aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-02-27 09:16:30 -0500
committerFelipe Balbi <balbi@ti.com>2013-03-18 05:17:59 -0400
commit25df6397a6c063811154868b868e8bd10e5ae9b1 (patch)
tree87d19ecb39c1074f096bca4fbd416291872d49b1
parentcedf8602373a3a5d02e49af7bebc401ffe3b38f3 (diff)
usb: phy: 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. Tested-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com> Reviewed-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/otg/mxs-phy.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c
index b0d9f119c749..aa403256d4b6 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)
127 void __iomem *base; 127 void __iomem *base;
128 struct clk *clk; 128 struct clk *clk;
129 struct mxs_phy *mxs_phy; 129 struct mxs_phy *mxs_phy;
130 int ret;
130 131
131 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 132 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
132 if (!res) { 133 if (!res) {
@@ -166,11 +167,19 @@ static int mxs_phy_probe(struct platform_device *pdev)
166 167
167 platform_set_drvdata(pdev, &mxs_phy->phy); 168 platform_set_drvdata(pdev, &mxs_phy->phy);
168 169
170 ret = usb_add_phy_dev(&mxs_phy->phy);
171 if (ret)
172 return ret;
173
169 return 0; 174 return 0;
170} 175}
171 176
172static int mxs_phy_remove(struct platform_device *pdev) 177static int mxs_phy_remove(struct platform_device *pdev)
173{ 178{
179 struct mxs_phy *mxs_phy = platform_get_drvdata(pdev);
180
181 usb_remove_phy(&mxs_phy->phy);
182
174 platform_set_drvdata(pdev, NULL); 183 platform_set_drvdata(pdev, NULL);
175 184
176 return 0; 185 return 0;