aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/davinci.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-10-31 11:12:43 -0400
committerFelipe Balbi <balbi@ti.com>2012-11-01 06:32:23 -0400
commit2f7711642559851c187d09795a3eb51c2bde36ec (patch)
treecc0663e2d53d0f4d6a5355c51fd5e30c843cafcd /drivers/usb/musb/davinci.c
parentb18d26f6ad8f00ea5f7c6a12ea52627ca3c3c6e2 (diff)
usb: musb: remove hand-crafted id handling
This replaced the handcrafted id handling by the PLATFORM_DEVID_AUTO value which should do the same thing. This patch probably also fixes ux500 because I did not find the "musbid" variable to remove. And we close a tiny-unlikely race window becuase the old code gave the id back before device was destroyed in the remove case. [ balbi@ti.com : fixed up two failed hunks when applying patch ] Cc: B, Ravi <ravibabu@ti.com> Cc: Santhapuri, Damodar <damodar.santhapuri@ti.com> Cc: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Cc: Bob Liu <lliubbo@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/davinci.c')
-rw-r--r--drivers/usb/musb/davinci.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 959a6d71e1d5..b3c0a943950c 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -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:
590err3: 580err3:
591 platform_device_put(musb); 581 platform_device_put(musb);
592 582
593err2:
594 musb_put_id(&pdev->dev, musbid);
595
596err1: 583err1:
597 kfree(glue); 584 kfree(glue);
598 585
@@ -604,7 +591,6 @@ static int __devexit 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);
608 platform_device_unregister(glue->musb); 594 platform_device_unregister(glue->musb);
609 clk_disable(glue->clk); 595 clk_disable(glue->clk);
610 clk_put(glue->clk); 596 clk_put(glue->clk);