diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2015-11-05 10:08:07 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-12-22 05:32:02 -0500 |
commit | 86236813ff23e0e8afc6844d307fb84df98f6723 (patch) | |
tree | fdb9d37a96f9f09b6454207f42f369ad80b83aa4 /drivers/mmc | |
parent | dc28562bf2d67c1ccbcd7ebdfc261f4316c02113 (diff) |
mmc: core: Invoke ->card_event() callback only when needed
The ->card_event() callback may be called when re-scan is disabled and for
non-removable cards, which both cases are unnecessary.
Instead let's move the call later in mmc_rescan() where these constraints
have been validated.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/core.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 5ae89e48fd85..c1027a432785 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -2567,11 +2567,6 @@ void mmc_rescan(struct work_struct *work) | |||
2567 | container_of(work, struct mmc_host, detect.work); | 2567 | container_of(work, struct mmc_host, detect.work); |
2568 | int i; | 2568 | int i; |
2569 | 2569 | ||
2570 | if (host->trigger_card_event && host->ops->card_event) { | ||
2571 | host->ops->card_event(host); | ||
2572 | host->trigger_card_event = false; | ||
2573 | } | ||
2574 | |||
2575 | if (host->rescan_disable) | 2570 | if (host->rescan_disable) |
2576 | return; | 2571 | return; |
2577 | 2572 | ||
@@ -2580,6 +2575,11 @@ void mmc_rescan(struct work_struct *work) | |||
2580 | return; | 2575 | return; |
2581 | host->rescan_entered = 1; | 2576 | host->rescan_entered = 1; |
2582 | 2577 | ||
2578 | if (host->trigger_card_event && host->ops->card_event) { | ||
2579 | host->ops->card_event(host); | ||
2580 | host->trigger_card_event = false; | ||
2581 | } | ||
2582 | |||
2583 | mmc_bus_get(host); | 2583 | mmc_bus_get(host); |
2584 | 2584 | ||
2585 | /* | 2585 | /* |