aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/mmc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/core/mmc.c')
-rw-r--r--drivers/mmc/core/mmc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index c86dd7384d7..16006ef153f 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -755,13 +755,18 @@ static void mmc_attach_bus_ops(struct mmc_host *host)
755/* 755/*
756 * Starting point for MMC card init. 756 * Starting point for MMC card init.
757 */ 757 */
758int mmc_attach_mmc(struct mmc_host *host, u32 ocr) 758int mmc_attach_mmc(struct mmc_host *host)
759{ 759{
760 int err; 760 int err;
761 u32 ocr;
761 762
762 BUG_ON(!host); 763 BUG_ON(!host);
763 WARN_ON(!host->claimed); 764 WARN_ON(!host->claimed);
764 765
766 err = mmc_send_op_cond(host, 0, &ocr);
767 if (err)
768 return err;
769
765 mmc_attach_bus_ops(host); 770 mmc_attach_bus_ops(host);
766 if (host->ocr_avail_mmc) 771 if (host->ocr_avail_mmc)
767 host->ocr_avail = host->ocr_avail_mmc; 772 host->ocr_avail = host->ocr_avail_mmc;
@@ -804,20 +809,20 @@ int mmc_attach_mmc(struct mmc_host *host, u32 ocr)
804 goto err; 809 goto err;
805 810
806 mmc_release_host(host); 811 mmc_release_host(host);
807
808 err = mmc_add_card(host->card); 812 err = mmc_add_card(host->card);
813 mmc_claim_host(host);
809 if (err) 814 if (err)
810 goto remove_card; 815 goto remove_card;
811 816
812 return 0; 817 return 0;
813 818
814remove_card: 819remove_card:
820 mmc_release_host(host);
815 mmc_remove_card(host->card); 821 mmc_remove_card(host->card);
816 host->card = NULL;
817 mmc_claim_host(host); 822 mmc_claim_host(host);
823 host->card = NULL;
818err: 824err:
819 mmc_detach_bus(host); 825 mmc_detach_bus(host);
820 mmc_release_host(host);
821 826
822 printk(KERN_ERR "%s: error %d whilst initialising MMC card\n", 827 printk(KERN_ERR "%s: error %d whilst initialising MMC card\n",
823 mmc_hostname(host), err); 828 mmc_hostname(host), err);