aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/am35x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/musb/am35x.c')
-rw-r--r--drivers/usb/musb/am35x.c40
1 files changed, 7 insertions, 33 deletions
diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index c964d6af178b..3d1c71b50f76 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -455,7 +455,7 @@ static const struct musb_platform_ops am35x_ops = {
455 455
456static u64 am35x_dmamask = DMA_BIT_MASK(32); 456static u64 am35x_dmamask = DMA_BIT_MASK(32);
457 457
458static int __devinit am35x_probe(struct platform_device *pdev) 458static int am35x_probe(struct platform_device *pdev)
459{ 459{
460 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 460 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
461 struct platform_device *musb; 461 struct platform_device *musb;
@@ -465,7 +465,6 @@ static int __devinit am35x_probe(struct platform_device *pdev)
465 struct clk *clk; 465 struct clk *clk;
466 466
467 int ret = -ENOMEM; 467 int ret = -ENOMEM;
468 int musbid;
469 468
470 glue = kzalloc(sizeof(*glue), GFP_KERNEL); 469 glue = kzalloc(sizeof(*glue), GFP_KERNEL);
471 if (!glue) { 470 if (!glue) {
@@ -473,18 +472,10 @@ static int __devinit am35x_probe(struct platform_device *pdev)
473 goto err0; 472 goto err0;
474 } 473 }
475 474
476 /* get the musb id */ 475 musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
477 musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
478 if (musbid < 0) {
479 dev_err(&pdev->dev, "failed to allocate musb id\n");
480 ret = -ENOMEM;
481 goto err1;
482 }
483
484 musb = platform_device_alloc("musb-hdrc", musbid);
485 if (!musb) { 476 if (!musb) {
486 dev_err(&pdev->dev, "failed to allocate musb device\n"); 477 dev_err(&pdev->dev, "failed to allocate musb device\n");
487 goto err2; 478 goto err1;
488 } 479 }
489 480
490 phy_clk = clk_get(&pdev->dev, "fck"); 481 phy_clk = clk_get(&pdev->dev, "fck");
@@ -513,7 +504,6 @@ static int __devinit am35x_probe(struct platform_device *pdev)
513 goto err6; 504 goto err6;
514 } 505 }
515 506
516 musb->id = musbid;
517 musb->dev.parent = &pdev->dev; 507 musb->dev.parent = &pdev->dev;
518 musb->dev.dma_mask = &am35x_dmamask; 508 musb->dev.dma_mask = &am35x_dmamask;
519 musb->dev.coherent_dma_mask = am35x_dmamask; 509 musb->dev.coherent_dma_mask = am35x_dmamask;
@@ -563,9 +553,6 @@ err4:
563err3: 553err3:
564 platform_device_put(musb); 554 platform_device_put(musb);
565 555
566err2:
567 musb_put_id(&pdev->dev, musbid);
568
569err1: 556err1:
570 kfree(glue); 557 kfree(glue);
571 558
@@ -573,13 +560,11 @@ err0:
573 return ret; 560 return ret;
574} 561}
575 562
576static int __devexit am35x_remove(struct platform_device *pdev) 563static int am35x_remove(struct platform_device *pdev)
577{ 564{
578 struct am35x_glue *glue = platform_get_drvdata(pdev); 565 struct am35x_glue *glue = platform_get_drvdata(pdev);
579 566
580 musb_put_id(&pdev->dev, glue->musb->id); 567 platform_device_unregister(glue->musb);
581 platform_device_del(glue->musb);
582 platform_device_put(glue->musb);
583 clk_disable(glue->clk); 568 clk_disable(glue->clk);
584 clk_disable(glue->phy_clk); 569 clk_disable(glue->phy_clk);
585 clk_put(glue->clk); 570 clk_put(glue->clk);
@@ -644,7 +629,7 @@ static struct dev_pm_ops am35x_pm_ops = {
644 629
645static struct platform_driver am35x_driver = { 630static struct platform_driver am35x_driver = {
646 .probe = am35x_probe, 631 .probe = am35x_probe,
647 .remove = __devexit_p(am35x_remove), 632 .remove = am35x_remove,
648 .driver = { 633 .driver = {
649 .name = "musb-am35x", 634 .name = "musb-am35x",
650 .pm = DEV_PM_OPS, 635 .pm = DEV_PM_OPS,
@@ -654,15 +639,4 @@ static struct platform_driver am35x_driver = {
654MODULE_DESCRIPTION("AM35x MUSB Glue Layer"); 639MODULE_DESCRIPTION("AM35x MUSB Glue Layer");
655MODULE_AUTHOR("Ajay Kumar Gupta <ajay.gupta@ti.com>"); 640MODULE_AUTHOR("Ajay Kumar Gupta <ajay.gupta@ti.com>");
656MODULE_LICENSE("GPL v2"); 641MODULE_LICENSE("GPL v2");
657 642module_platform_driver(am35x_driver);
658static int __init am35x_init(void)
659{
660 return platform_driver_register(&am35x_driver);
661}
662module_init(am35x_init);
663
664static void __exit am35x_exit(void)
665{
666 platform_driver_unregister(&am35x_driver);
667}
668module_exit(am35x_exit);