From: Sergei Shtylyov Date: Wed, 14 Oct 2015 20:53:03 +0000 (+0300) Subject: mmc: skip reclaiming host on mmc_add_card() error X-Git-Tag: v5.15~14854^2~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2860d060ac902df0164cc9580f843b101e27a2c6;p=platform%2Fkernel%2Flinux-starfive.git mmc: skip reclaiming host on mmc_add_card() error There's little sense in releasing the host on mmc_add_card() error immediately after reclaiming it, so reclaim the host only in case of success. Signed-off-by: Sergei Shtylyov Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 479b84a..c793fda 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -2004,14 +2004,13 @@ int mmc_attach_mmc(struct mmc_host *host) mmc_release_host(host); err = mmc_add_card(host->card); - mmc_claim_host(host); if (err) goto remove_card; + mmc_claim_host(host); return 0; remove_card: - mmc_release_host(host); mmc_remove_card(host->card); mmc_claim_host(host); host->card = NULL; diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index b1b9200..141eaa9 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1243,14 +1243,13 @@ int mmc_attach_sd(struct mmc_host *host) mmc_release_host(host); err = mmc_add_card(host->card); - mmc_claim_host(host); if (err) goto remove_card; + mmc_claim_host(host); return 0; remove_card: - mmc_release_host(host); mmc_remove_card(host->card); host->card = NULL; mmc_claim_host(host);