aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/core/sd.c')
-rw-r--r--drivers/mmc/core/sd.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index df3bbfea226..0b478de48ac 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -573,14 +573,17 @@ static void mmc_sd_resume(struct mmc_host *host)
573 BUG_ON(!host->card); 573 BUG_ON(!host->card);
574 574
575 mmc_claim_host(host); 575 mmc_claim_host(host);
576
577 err = mmc_sd_init_card(host, host->ocr, host->card); 576 err = mmc_sd_init_card(host, host->ocr, host->card);
577 mmc_release_host(host);
578
578 if (err != MMC_ERR_NONE) { 579 if (err != MMC_ERR_NONE) {
579 mmc_sd_remove(host); 580 mmc_sd_remove(host);
581
582 mmc_claim_host(host);
580 mmc_detach_bus(host); 583 mmc_detach_bus(host);
584 mmc_release_host(host);
581 } 585 }
582 586
583 mmc_release_host(host);
584} 587}
585 588
586#else 589#else
@@ -648,14 +651,14 @@ int mmc_attach_sd(struct mmc_host *host, u32 ocr)
648 651
649 err = mmc_add_card(host->card); 652 err = mmc_add_card(host->card);
650 if (err) 653 if (err)
651 goto reclaim_host; 654 goto remove_card;
652 655
653 return 0; 656 return 0;
654 657
655reclaim_host: 658remove_card:
656 mmc_claim_host(host);
657 mmc_remove_card(host->card); 659 mmc_remove_card(host->card);
658 host->card = NULL; 660 host->card = NULL;
661 mmc_claim_host(host);
659err: 662err:
660 mmc_detach_bus(host); 663 mmc_detach_bus(host);
661 mmc_release_host(host); 664 mmc_release_host(host);