diff options
Diffstat (limited to 'drivers/usb/musb/davinci.c')
-rw-r--r-- | drivers/usb/musb/davinci.c | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 606bfd00cde6..b1c01cad28b2 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c | |||
@@ -504,7 +504,7 @@ static const struct musb_platform_ops davinci_ops = { | |||
504 | 504 | ||
505 | static u64 davinci_dmamask = DMA_BIT_MASK(32); | 505 | static u64 davinci_dmamask = DMA_BIT_MASK(32); |
506 | 506 | ||
507 | static int __devinit davinci_probe(struct platform_device *pdev) | 507 | static int davinci_probe(struct platform_device *pdev) |
508 | { | 508 | { |
509 | struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; | 509 | struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; |
510 | struct platform_device *musb; | 510 | struct platform_device *musb; |
@@ -512,7 +512,6 @@ static int __devinit davinci_probe(struct platform_device *pdev) | |||
512 | struct clk *clk; | 512 | struct clk *clk; |
513 | 513 | ||
514 | int ret = -ENOMEM; | 514 | int ret = -ENOMEM; |
515 | int musbid; | ||
516 | 515 | ||
517 | glue = kzalloc(sizeof(*glue), GFP_KERNEL); | 516 | glue = kzalloc(sizeof(*glue), GFP_KERNEL); |
518 | if (!glue) { | 517 | if (!glue) { |
@@ -520,18 +519,10 @@ static int __devinit davinci_probe(struct platform_device *pdev) | |||
520 | goto err0; | 519 | goto err0; |
521 | } | 520 | } |
522 | 521 | ||
523 | /* get the musb id */ | 522 | musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO); |
524 | musbid = musb_get_id(&pdev->dev, GFP_KERNEL); | ||
525 | if (musbid < 0) { | ||
526 | dev_err(&pdev->dev, "failed to allocate musb id\n"); | ||
527 | ret = -ENOMEM; | ||
528 | goto err1; | ||
529 | } | ||
530 | |||
531 | musb = platform_device_alloc("musb-hdrc", musbid); | ||
532 | if (!musb) { | 523 | if (!musb) { |
533 | dev_err(&pdev->dev, "failed to allocate musb device\n"); | 524 | dev_err(&pdev->dev, "failed to allocate musb device\n"); |
534 | goto err2; | 525 | goto err1; |
535 | } | 526 | } |
536 | 527 | ||
537 | clk = clk_get(&pdev->dev, "usb"); | 528 | clk = clk_get(&pdev->dev, "usb"); |
@@ -547,7 +538,6 @@ static int __devinit davinci_probe(struct platform_device *pdev) | |||
547 | goto err4; | 538 | goto err4; |
548 | } | 539 | } |
549 | 540 | ||
550 | musb->id = musbid; | ||
551 | musb->dev.parent = &pdev->dev; | 541 | musb->dev.parent = &pdev->dev; |
552 | musb->dev.dma_mask = &davinci_dmamask; | 542 | musb->dev.dma_mask = &davinci_dmamask; |
553 | musb->dev.coherent_dma_mask = davinci_dmamask; | 543 | musb->dev.coherent_dma_mask = davinci_dmamask; |
@@ -590,9 +580,6 @@ err4: | |||
590 | err3: | 580 | err3: |
591 | platform_device_put(musb); | 581 | platform_device_put(musb); |
592 | 582 | ||
593 | err2: | ||
594 | musb_put_id(&pdev->dev, musbid); | ||
595 | |||
596 | err1: | 583 | err1: |
597 | kfree(glue); | 584 | kfree(glue); |
598 | 585 | ||
@@ -600,13 +587,11 @@ err0: | |||
600 | return ret; | 587 | return ret; |
601 | } | 588 | } |
602 | 589 | ||
603 | static int __devexit davinci_remove(struct platform_device *pdev) | 590 | static int davinci_remove(struct platform_device *pdev) |
604 | { | 591 | { |
605 | struct davinci_glue *glue = platform_get_drvdata(pdev); | 592 | struct davinci_glue *glue = platform_get_drvdata(pdev); |
606 | 593 | ||
607 | musb_put_id(&pdev->dev, glue->musb->id); | 594 | platform_device_unregister(glue->musb); |
608 | platform_device_del(glue->musb); | ||
609 | platform_device_put(glue->musb); | ||
610 | clk_disable(glue->clk); | 595 | clk_disable(glue->clk); |
611 | clk_put(glue->clk); | 596 | clk_put(glue->clk); |
612 | kfree(glue); | 597 | kfree(glue); |
@@ -616,7 +601,7 @@ static int __devexit davinci_remove(struct platform_device *pdev) | |||
616 | 601 | ||
617 | static struct platform_driver davinci_driver = { | 602 | static struct platform_driver davinci_driver = { |
618 | .probe = davinci_probe, | 603 | .probe = davinci_probe, |
619 | .remove = __devexit_p(davinci_remove), | 604 | .remove = davinci_remove, |
620 | .driver = { | 605 | .driver = { |
621 | .name = "musb-davinci", | 606 | .name = "musb-davinci", |
622 | }, | 607 | }, |
@@ -625,15 +610,4 @@ static struct platform_driver davinci_driver = { | |||
625 | MODULE_DESCRIPTION("DaVinci MUSB Glue Layer"); | 610 | MODULE_DESCRIPTION("DaVinci MUSB Glue Layer"); |
626 | MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>"); | 611 | MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>"); |
627 | MODULE_LICENSE("GPL v2"); | 612 | MODULE_LICENSE("GPL v2"); |
628 | 613 | module_platform_driver(davinci_driver); | |
629 | static int __init davinci_init(void) | ||
630 | { | ||
631 | return platform_driver_register(&davinci_driver); | ||
632 | } | ||
633 | module_init(davinci_init); | ||
634 | |||
635 | static void __exit davinci_exit(void) | ||
636 | { | ||
637 | platform_driver_unregister(&davinci_driver); | ||
638 | } | ||
639 | module_exit(davinci_exit); | ||