mmc: block: switch card to User Data Area when removing the block driver
authorAdrian Hunter <adrian.hunter@intel.com>
Thu, 23 Jun 2011 10:40:26 +0000 (13:40 +0300)
committerChris Ball <cjb@laptop.org>
Sat, 25 Jun 2011 22:52:49 +0000 (18:52 -0400)
The MMC block driver and other drivers (e.g. mmc-test) will expect
the card to be switched to the User Data Area eMMC partition when
they start.  Hence the MMC block driver should ensure it is that
way when it is removed.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andrei Warkentin <andreiw@motorola.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/card/block.c

index 71da5641e258e041cb9b72439d3d18eac9d9baa9..77cd083a51e46ac4fa70060d4b9950289d006f8a 100644 (file)
@@ -1297,6 +1297,9 @@ static void mmc_blk_remove(struct mmc_card *card)
        struct mmc_blk_data *md = mmc_get_drvdata(card);
 
        mmc_blk_remove_parts(card, md);
+       mmc_claim_host(card->host);
+       mmc_blk_part_switch(card, md);
+       mmc_release_host(card->host);
        mmc_blk_remove_req(md);
        mmc_set_drvdata(card, NULL);
 }