summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2015-11-05 15:08:07 (GMT)
committerUlf Hansson <ulf.hansson@linaro.org>2015-12-22 10:32:02 (GMT)
commit86236813ff23e0e8afc6844d307fb84df98f6723 (patch)
treefdb9d37a96f9f09b6454207f42f369ad80b83aa4 /drivers/mmc
parentdc28562bf2d67c1ccbcd7ebdfc261f4316c02113 (diff)
downloadlinux-86236813ff23e0e8afc6844d307fb84df98f6723.tar.xz
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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 5ae89e4..c1027a4 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2567,11 +2567,6 @@ void mmc_rescan(struct work_struct *work)
container_of(work, struct mmc_host, detect.work);
int i;
- if (host->trigger_card_event && host->ops->card_event) {
- host->ops->card_event(host);
- host->trigger_card_event = false;
- }
-
if (host->rescan_disable)
return;
@@ -2580,6 +2575,11 @@ void mmc_rescan(struct work_struct *work)
return;
host->rescan_entered = 1;
+ if (host->trigger_card_event && host->ops->card_event) {
+ host->ops->card_event(host);
+ host->trigger_card_event = false;
+ }
+
mmc_bus_get(host);
/*