diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2015-10-14 23:53:03 +0300 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-10-26 16:00:14 +0100 |
commit | 2860d060ac902df0164cc9580f843b101e27a2c6 (patch) | |
tree | 43e730efdee8406e8105b43743523af41849cd01 /drivers/mmc/core/sd.c | |
parent | 7f8a9a7e98f99e9cd874eaf6ca2f00438c2a7c38 (diff) | |
download | linux-2860d060ac902df0164cc9580f843b101e27a2c6.tar.bz2 |
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 <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/sd.c')
-rw-r--r-- | drivers/mmc/core/sd.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index b1b9200a4715..141eaa923e18 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); |