Commit 0e38c4ed83027e7e7d16568e43fb34a32c14f800

Authored by Ajay Kumar Gupta
Committed by Felipe Balbi
1 parent 3bb5534853

usb: musb: reorder runtime pm call

The clock need to be enabled before the musb_core platform device is
created and registered.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

Showing 1 changed file with 9 additions and 8 deletions Side-by-side Diff

drivers/usb/musb/musb_dsps.c
... ... @@ -566,27 +566,28 @@
566 566 }
567 567 platform_set_drvdata(pdev, glue);
568 568  
569   - /* create the child platform device for first instances of musb */
570   - ret = dsps_create_musb_pdev(glue, 0);
571   - if (ret != 0) {
572   - dev_err(&pdev->dev, "failed to create child pdev\n");
573   - goto err2;
574   - }
575   -
576 569 /* enable the usbss clocks */
577 570 pm_runtime_enable(&pdev->dev);
578 571  
579 572 ret = pm_runtime_get_sync(&pdev->dev);
580 573 if (ret < 0) {
581 574 dev_err(&pdev->dev, "pm_runtime_get_sync FAILED");
  575 + goto err2;
  576 + }
  577 +
  578 + /* create the child platform device for first instances of musb */
  579 + ret = dsps_create_musb_pdev(glue, 0);
  580 + if (ret != 0) {
  581 + dev_err(&pdev->dev, "failed to create child pdev\n");
582 582 goto err3;
583 583 }
584 584  
585 585 return 0;
586 586  
587 587 err3:
588   - pm_runtime_disable(&pdev->dev);
  588 + pm_runtime_put(&pdev->dev);
589 589 err2:
  590 + pm_runtime_disable(&pdev->dev);
590 591 kfree(glue->wrp);
591 592 err1:
592 593 kfree(glue);