diff options
author | Johan Rudholm <johan.rudholm@axis.com> | 2015-01-12 09:38:04 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-01-19 03:56:27 -0500 |
commit | 83533ab28380f6957af39a7b322e639e42dbdaf1 (patch) | |
tree | 2b7a8f3e11e0beef743e13fbf2862605b279d611 /drivers/mmc/core | |
parent | 25185f3f31c924eecc6ff4f55f7acceabf24de11 (diff) |
mmc: core: always check status after reset
Always check if the card is alive after a successful reset. This allows
us to remove mmc_hw_reset_check(), leaving mmc_hw_reset() as the only
card reset interface.
Signed-off-by: Johan Rudholm <johanru@axis.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r-- | drivers/mmc/core/core.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index d3bfbdfab052..72070f188cc5 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -2286,9 +2286,10 @@ int mmc_can_reset(struct mmc_card *card) | |||
2286 | } | 2286 | } |
2287 | EXPORT_SYMBOL(mmc_can_reset); | 2287 | EXPORT_SYMBOL(mmc_can_reset); |
2288 | 2288 | ||
2289 | static int mmc_do_hw_reset(struct mmc_host *host, int check) | 2289 | int mmc_hw_reset(struct mmc_host *host) |
2290 | { | 2290 | { |
2291 | struct mmc_card *card = host->card; | 2291 | struct mmc_card *card = host->card; |
2292 | u32 status; | ||
2292 | 2293 | ||
2293 | if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset) | 2294 | if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset) |
2294 | return -EOPNOTSUPP; | 2295 | return -EOPNOTSUPP; |
@@ -2305,13 +2306,9 @@ static int mmc_do_hw_reset(struct mmc_host *host, int check) | |||
2305 | host->ops->hw_reset(host); | 2306 | host->ops->hw_reset(host); |
2306 | 2307 | ||
2307 | /* If the reset has happened, then a status command will fail */ | 2308 | /* If the reset has happened, then a status command will fail */ |
2308 | if (check) { | 2309 | if (!mmc_send_status(card, &status)) { |
2309 | u32 status; | 2310 | mmc_host_clk_release(host); |
2310 | 2311 | return -ENOSYS; | |
2311 | if (!mmc_send_status(card, &status)) { | ||
2312 | mmc_host_clk_release(host); | ||
2313 | return -ENOSYS; | ||
2314 | } | ||
2315 | } | 2312 | } |
2316 | 2313 | ||
2317 | /* Set initial state and call mmc_set_ios */ | 2314 | /* Set initial state and call mmc_set_ios */ |
@@ -2321,19 +2318,8 @@ static int mmc_do_hw_reset(struct mmc_host *host, int check) | |||
2321 | 2318 | ||
2322 | return host->bus_ops->power_restore(host); | 2319 | return host->bus_ops->power_restore(host); |
2323 | } | 2320 | } |
2324 | |||
2325 | int mmc_hw_reset(struct mmc_host *host) | ||
2326 | { | ||
2327 | return mmc_do_hw_reset(host, 0); | ||
2328 | } | ||
2329 | EXPORT_SYMBOL(mmc_hw_reset); | 2321 | EXPORT_SYMBOL(mmc_hw_reset); |
2330 | 2322 | ||
2331 | int mmc_hw_reset_check(struct mmc_host *host) | ||
2332 | { | ||
2333 | return mmc_do_hw_reset(host, 1); | ||
2334 | } | ||
2335 | EXPORT_SYMBOL(mmc_hw_reset_check); | ||
2336 | |||
2337 | static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq) | 2323 | static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq) |
2338 | { | 2324 | { |
2339 | host->f_init = freq; | 2325 | host->f_init = freq; |