diff options
author | Felipe Balbi <balbi@ti.com> | 2013-04-24 10:21:42 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-05-28 12:00:49 -0400 |
commit | 09fc7d22b024692b2fe8a943b246de1af307132b (patch) | |
tree | f7f48e981a398c43103110ca688d484810d11ba1 /drivers/usb/musb/omap2430.c | |
parent | e4aa937ec75df0eea0bee03bffa3303ad36c986b (diff) |
usb: musb: fix incorrect usage of resource pointer
We can't simply pass the resource pointer from our
device down to our children, otherwise module
reinsertion will not work as the resource will
continue to be marked as busy.
Fix it by building a proper struct resource for
our child musb device.
Tested-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/omap2430.c')
-rw-r--r-- | drivers/usb/musb/omap2430.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 628b93fe5ccc..b3e77613e0af 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -481,6 +481,7 @@ static u64 omap2430_dmamask = DMA_BIT_MASK(32); | |||
481 | 481 | ||
482 | static int omap2430_probe(struct platform_device *pdev) | 482 | static int omap2430_probe(struct platform_device *pdev) |
483 | { | 483 | { |
484 | struct resource musb_resouces[2]; | ||
484 | struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; | 485 | struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; |
485 | struct omap_musb_board_data *data; | 486 | struct omap_musb_board_data *data; |
486 | struct platform_device *musb; | 487 | struct platform_device *musb; |
@@ -567,8 +568,21 @@ static int omap2430_probe(struct platform_device *pdev) | |||
567 | 568 | ||
568 | INIT_WORK(&glue->omap_musb_mailbox_work, omap_musb_mailbox_work); | 569 | INIT_WORK(&glue->omap_musb_mailbox_work, omap_musb_mailbox_work); |
569 | 570 | ||
570 | ret = platform_device_add_resources(musb, pdev->resource, | 571 | memset(musb_resouces, 0x00, sizeof(*musb_resources) * |
571 | pdev->num_resources); | 572 | ARRAY_SIZE(musb_resources)); |
573 | |||
574 | musb_resources[0].name = pdev->resource[0].name; | ||
575 | musb_resources[0].start = pdev->resource[0].start; | ||
576 | musb_resources[0].end = pdev->resource[0].end; | ||
577 | musb_resources[0].flags = pdev->resource[0].flags; | ||
578 | |||
579 | musb_resources[1].name = pdev->resource[1].name; | ||
580 | musb_resources[1].start = pdev->resource[1].start; | ||
581 | musb_resources[1].end = pdev->resource[1].end; | ||
582 | musb_resources[1].flags = pdev->resource[1].flags; | ||
583 | |||
584 | ret = platform_device_add_resources(musb, musb_resources, | ||
585 | ARRAY_SIZE(musb_resources)); | ||
572 | if (ret) { | 586 | if (ret) { |
573 | dev_err(&pdev->dev, "failed to add resources\n"); | 587 | dev_err(&pdev->dev, "failed to add resources\n"); |
574 | goto err2; | 588 | goto err2; |