usb: phy: generic: allow multiples calls to usb_phy_generic_register()

it's now very easy to return a platform_device pointer
and have the caller pass it as argument when calling
usb_phy_generic_unregister().

Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
Felipe Balbi
2014-04-16 16:16:33 -05:00
parent e741e637a8
commit 2f36ff6915
6 changed files with 40 additions and 27 deletions

View File

@@ -31,6 +31,7 @@
struct tusb6010_glue {
struct device *dev;
struct platform_device *musb;
struct platform_device *phy;
};
static void tusb_musb_set_vbus(struct musb *musb, int is_on);
@@ -1222,7 +1223,7 @@ static int tusb_remove(struct platform_device *pdev)
struct tusb6010_glue *glue = platform_get_drvdata(pdev);
platform_device_unregister(glue->musb);
usb_phy_generic_unregister();
usb_phy_generic_unregister(glue->phy);
kfree(glue);
return 0;