diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-10-31 11:12:43 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-11-01 06:32:23 -0400 |
commit | 2f7711642559851c187d09795a3eb51c2bde36ec (patch) | |
tree | cc0663e2d53d0f4d6a5355c51fd5e30c843cafcd /drivers/usb/musb/blackfin.c | |
parent | b18d26f6ad8f00ea5f7c6a12ea52627ca3c3c6e2 (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/blackfin.c')
-rw-r--r-- | drivers/usb/musb/blackfin.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index 307e726a2bd7..7e4d60a41728 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c | |||
@@ -455,7 +455,6 @@ static int __devinit bfin_probe(struct platform_device *pdev) | |||
455 | struct bfin_glue *glue; | 455 | struct bfin_glue *glue; |
456 | 456 | ||
457 | int ret = -ENOMEM; | 457 | int ret = -ENOMEM; |
458 | int musbid; | ||
459 | 458 | ||
460 | glue = kzalloc(sizeof(*glue), GFP_KERNEL); | 459 | glue = kzalloc(sizeof(*glue), GFP_KERNEL); |
461 | if (!glue) { | 460 | if (!glue) { |
@@ -463,21 +462,12 @@ static int __devinit bfin_probe(struct platform_device *pdev) | |||
463 | goto err0; | 462 | goto err0; |
464 | } | 463 | } |
465 | 464 | ||
466 | /* get the musb id */ | 465 | musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO); |
467 | musbid = musb_get_id(&pdev->dev, GFP_KERNEL); | ||
468 | if (musbid < 0) { | ||
469 | dev_err(&pdev->dev, "failed to allocate musb id\n"); | ||
470 | ret = -ENOMEM; | ||
471 | goto err1; | ||
472 | } | ||
473 | |||
474 | musb = platform_device_alloc("musb-hdrc", musbid); | ||
475 | if (!musb) { | 466 | if (!musb) { |
476 | dev_err(&pdev->dev, "failed to allocate musb device\n"); | 467 | dev_err(&pdev->dev, "failed to allocate musb device\n"); |
477 | goto err2; | 468 | goto err1; |
478 | } | 469 | } |
479 | 470 | ||
480 | musb->id = musbid; | ||
481 | musb->dev.parent = &pdev->dev; | 471 | musb->dev.parent = &pdev->dev; |
482 | musb->dev.dma_mask = &bfin_dmamask; | 472 | musb->dev.dma_mask = &bfin_dmamask; |
483 | musb->dev.coherent_dma_mask = bfin_dmamask; | 473 | musb->dev.coherent_dma_mask = bfin_dmamask; |
@@ -513,9 +503,6 @@ static int __devinit bfin_probe(struct platform_device *pdev) | |||
513 | err3: | 503 | err3: |
514 | platform_device_put(musb); | 504 | platform_device_put(musb); |
515 | 505 | ||
516 | err2: | ||
517 | musb_put_id(&pdev->dev, musbid); | ||
518 | |||
519 | err1: | 506 | err1: |
520 | kfree(glue); | 507 | kfree(glue); |
521 | 508 | ||
@@ -527,7 +514,6 @@ static int __devexit bfin_remove(struct platform_device *pdev) | |||
527 | { | 514 | { |
528 | struct bfin_glue *glue = platform_get_drvdata(pdev); | 515 | struct bfin_glue *glue = platform_get_drvdata(pdev); |
529 | 516 | ||
530 | musb_put_id(&pdev->dev, glue->musb->id); | ||
531 | platform_device_unregister(glue->musb); | 517 | platform_device_unregister(glue->musb); |
532 | kfree(glue); | 518 | kfree(glue); |
533 | 519 | ||