}
}
-
/*
* Callback for suspend
*/
static int mmc_sd_suspend(struct mmc_host *host)
{
- int err;
+ int err = 0;
BUG_ON(!host);
BUG_ON(!host->card);
mmc_claim_host(host);
if (mmc_card_suspended(host->card))
- goto out;
- if (!mmc_host_is_spi(host))
- err = mmc_deselect_cards(host);
-
- host->card->state &= ~MMC_STATE_HIGHSPEED;
- if (!err) {
- mmc_power_off(host);
- mmc_card_set_suspended(host->card);
- }
-out:
- mmc_release_host(host);
- return err;
+ goto out;
+
+ if (!mmc_host_is_spi(host))
+ err = mmc_deselect_cards(host);
+ host->card->state &= ~MMC_STATE_HIGHSPEED;
+ if (!err) {
+ mmc_power_off(host);
+ mmc_card_set_suspended(host->card);
+ }
+out:
+ mmc_release_host(host);
+ return err;
}
/*