Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316978
b: refs/heads/master
c: b1183c2
h: refs/heads/master
v: v3
  • Loading branch information
Kishon Vijay Abraham I authored and Felipe Balbi committed Jun 25, 2012
1 parent 68d12bd commit 8ae2bea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c83a8542b5e3c5b30825955a68b1cc8bd24b122a
refs/heads/master: b1183c242a60764afbdfaf39396405b7afa1106c
19 changes: 7 additions & 12 deletions trunk/drivers/usb/musb/omap2430.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static int omap2430_musb_init(struct musb *musb)
* up through ULPI. TWL4030-family PMICs include one,
* which needs a driver, drivers aren't always needed.
*/
musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
musb->xceiv = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
if (!musb->xceiv) {
pr_err("HS USB OTG: no transceiver configured\n");
return -ENODEV;
Expand Down Expand Up @@ -416,7 +416,6 @@ static int omap2430_musb_exit(struct musb *musb)
del_timer_sync(&musb_idle_timer);

omap2430_low_level_exit(musb);
usb_put_phy(musb->xceiv);

return 0;
}
Expand All @@ -443,7 +442,7 @@ static int __devinit omap2430_probe(struct platform_device *pdev)
struct omap2430_glue *glue;
int ret = -ENOMEM;

glue = kzalloc(sizeof(*glue), GFP_KERNEL);
glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
if (!glue) {
dev_err(&pdev->dev, "failed to allocate glue context\n");
goto err0;
Expand All @@ -452,7 +451,7 @@ static int __devinit omap2430_probe(struct platform_device *pdev)
musb = platform_device_alloc("musb-hdrc", -1);
if (!musb) {
dev_err(&pdev->dev, "failed to allocate musb device\n");
goto err1;
goto err0;
}

musb->dev.parent = &pdev->dev;
Expand All @@ -479,30 +478,27 @@ static int __devinit omap2430_probe(struct platform_device *pdev)
pdev->num_resources);
if (ret) {
dev_err(&pdev->dev, "failed to add resources\n");
goto err2;
goto err1;
}

ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
if (ret) {
dev_err(&pdev->dev, "failed to add platform_data\n");
goto err2;
goto err1;
}

pm_runtime_enable(&pdev->dev);

ret = platform_device_add(musb);
if (ret) {
dev_err(&pdev->dev, "failed to register musb device\n");
goto err2;
goto err1;
}

return 0;

err2:
platform_device_put(musb);

err1:
kfree(glue);
platform_device_put(musb);

err0:
return ret;
Expand All @@ -515,7 +511,6 @@ static int __devexit omap2430_remove(struct platform_device *pdev)
cancel_work_sync(&glue->omap_musb_mailbox_work);
platform_device_del(glue->musb);
platform_device_put(glue->musb);
kfree(glue);

return 0;
}
Expand Down

0 comments on commit 8ae2bea

Please sign in to comment.