mmc:Fix error handling in the function mmc_blk_remove
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Nicholas Krause
This fixes error handling in the function
mmc_blk_removeby checking the return value of the call tommc_blk_part_switchand if it has failed by returning a error code we now print out on the console to the user that removed the mmc device has failed before returning immediately.
A removal function isn't allowed to fail. Printing an error message seems reasonable (though it should be printed using one of the dev_ logging functions), but returning early is not.
Ben.
Quoted 21 lines
Signed-off-by Nicholas Krause <[email protected]>--- drivers/mmc/card/block.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/mmc/card/block.c +4
-1@@ -2508,7 +2508,10 @@ static void mmc_blk_remove(struct mmc_card *card) > > mmc_blk_remove_parts(card, md); > > pm_runtime_get_sync(&card->dev); > > mmc_claim_host(card->host); -> > mmc_blk_part_switch(card, md); +> > if (mmc_blk_part_switch(card, md)) { +> > > pr_crit("Unable to successfully remove %s due to failed mmc_blk_part_switch call\n", card->part[MMC_NUM_PHY_PARTITION].name); +> > > return; +> > } > > mmc_release_host(card->host); > > if (card->type != MMC_TYPE_SD_COMBO) > > > pm_runtime_disable(&card->dev);
Signature · 2 lines
Ben Hutchings No political challenge can be met by shopping. - George Monbiot