usb: musb: move usb_phy_generic_{un,}register calls to probe()/remove()
This patch is in preparation to supporting
calling those functions multiple times.
Signed-off-by: Felipe Balbi <balbi@ti.com>
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index 8d4a819..e1da199 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -1065,7 +1065,6 @@
void __iomem *sync = NULL;
int ret;
- usb_phy_generic_register();
musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb->xceiv))
return -EPROBE_DEFER;
@@ -1117,7 +1116,6 @@
iounmap(sync);
usb_put_phy(musb->xceiv);
- usb_phy_generic_unregister();
}
return ret;
}
@@ -1133,7 +1131,6 @@
iounmap(musb->sync_va);
usb_put_phy(musb->xceiv);
- usb_phy_generic_unregister();
return 0;
}
@@ -1176,6 +1173,7 @@
pdata->platform_ops = &tusb_ops;
+ usb_phy_generic_register();
platform_set_drvdata(pdev, glue);
memset(musb_resources, 0x00, sizeof(*musb_resources) *
@@ -1224,6 +1222,7 @@
struct tusb6010_glue *glue = platform_get_drvdata(pdev);
platform_device_unregister(glue->musb);
+ usb_phy_generic_unregister();
kfree(glue);
return 0;