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>
This commit is contained in:
@@ -401,7 +401,6 @@ static int bfin_musb_init(struct musb *musb)
|
||||
}
|
||||
gpio_direction_output(musb->config->gpio_vrsel, 0);
|
||||
|
||||
usb_phy_generic_register();
|
||||
musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
|
||||
if (IS_ERR_OR_NULL(musb->xceiv)) {
|
||||
gpio_free(musb->config->gpio_vrsel);
|
||||
@@ -424,9 +423,8 @@ static int bfin_musb_init(struct musb *musb)
|
||||
static int bfin_musb_exit(struct musb *musb)
|
||||
{
|
||||
gpio_free(musb->config->gpio_vrsel);
|
||||
|
||||
usb_put_phy(musb->xceiv);
|
||||
usb_phy_generic_unregister();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -477,6 +475,7 @@ static int bfin_probe(struct platform_device *pdev)
|
||||
|
||||
pdata->platform_ops = &bfin_ops;
|
||||
|
||||
usb_phy_generic_register();
|
||||
platform_set_drvdata(pdev, glue);
|
||||
|
||||
memset(musb_resources, 0x00, sizeof(*musb_resources) *
|
||||
@@ -528,6 +527,7 @@ static int bfin_remove(struct platform_device *pdev)
|
||||
struct bfin_glue *glue = platform_get_drvdata(pdev);
|
||||
|
||||
platform_device_unregister(glue->musb);
|
||||
usb_phy_generic_unregister();
|
||||
kfree(glue);
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user