diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2013-10-03 05:24:44 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-10-30 20:28:41 -0400 |
commit | 0cc81a8c6442e43618ff245948bfaa14fdf7938b (patch) | |
tree | b3efd2802c60f8e88b0a3468753039d487587fca /drivers/mmc | |
parent | 9ec775f7efd6d17084b4f361804d2030d50fca0e (diff) |
mmc: core: Remove redundant mmc_power_up|off at runtime callbacks
Commit "mmc: core: Push common suspend|resume code into each bus_ops"
moved the responsibility for doing mmc_power_up|off into each
suspend/resume bus_ops. When using MMC_CAP_AGGRESSIVE_PM, through the
runtime callbacks, calls to mmc_power_up|off became redundant.
When removing them, we are also able to remove the calls to
mmc_claim|release_host, thus simplifing code a bit more.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/mmc.c | 13 | ||||
-rw-r--r-- | drivers/mmc/core/sd.c | 13 |
2 files changed, 2 insertions, 24 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 84d8694cf369..b22eff80a95e 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -1575,18 +1575,11 @@ static int mmc_runtime_suspend(struct mmc_host *host) | |||
1575 | if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) | 1575 | if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) |
1576 | return 0; | 1576 | return 0; |
1577 | 1577 | ||
1578 | mmc_claim_host(host); | ||
1579 | |||
1580 | err = mmc_suspend(host); | 1578 | err = mmc_suspend(host); |
1581 | if (err) { | 1579 | if (err) |
1582 | pr_err("%s: error %d doing aggessive suspend\n", | 1580 | pr_err("%s: error %d doing aggessive suspend\n", |
1583 | mmc_hostname(host), err); | 1581 | mmc_hostname(host), err); |
1584 | goto out; | ||
1585 | } | ||
1586 | mmc_power_off(host); | ||
1587 | 1582 | ||
1588 | out: | ||
1589 | mmc_release_host(host); | ||
1590 | return err; | 1583 | return err; |
1591 | } | 1584 | } |
1592 | 1585 | ||
@@ -1600,15 +1593,11 @@ static int mmc_runtime_resume(struct mmc_host *host) | |||
1600 | if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) | 1593 | if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) |
1601 | return 0; | 1594 | return 0; |
1602 | 1595 | ||
1603 | mmc_claim_host(host); | ||
1604 | |||
1605 | mmc_power_up(host, host->card->ocr); | ||
1606 | err = mmc_resume(host); | 1596 | err = mmc_resume(host); |
1607 | if (err) | 1597 | if (err) |
1608 | pr_err("%s: error %d doing aggessive resume\n", | 1598 | pr_err("%s: error %d doing aggessive resume\n", |
1609 | mmc_hostname(host), err); | 1599 | mmc_hostname(host), err); |
1610 | 1600 | ||
1611 | mmc_release_host(host); | ||
1612 | return 0; | 1601 | return 0; |
1613 | } | 1602 | } |
1614 | 1603 | ||
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 685796560f8b..7b2854009e39 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c | |||
@@ -1132,18 +1132,11 @@ static int mmc_sd_runtime_suspend(struct mmc_host *host) | |||
1132 | if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) | 1132 | if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) |
1133 | return 0; | 1133 | return 0; |
1134 | 1134 | ||
1135 | mmc_claim_host(host); | ||
1136 | |||
1137 | err = mmc_sd_suspend(host); | 1135 | err = mmc_sd_suspend(host); |
1138 | if (err) { | 1136 | if (err) |
1139 | pr_err("%s: error %d doing aggessive suspend\n", | 1137 | pr_err("%s: error %d doing aggessive suspend\n", |
1140 | mmc_hostname(host), err); | 1138 | mmc_hostname(host), err); |
1141 | goto out; | ||
1142 | } | ||
1143 | mmc_power_off(host); | ||
1144 | 1139 | ||
1145 | out: | ||
1146 | mmc_release_host(host); | ||
1147 | return err; | 1140 | return err; |
1148 | } | 1141 | } |
1149 | 1142 | ||
@@ -1157,15 +1150,11 @@ static int mmc_sd_runtime_resume(struct mmc_host *host) | |||
1157 | if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) | 1150 | if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) |
1158 | return 0; | 1151 | return 0; |
1159 | 1152 | ||
1160 | mmc_claim_host(host); | ||
1161 | |||
1162 | mmc_power_up(host, host->card->ocr); | ||
1163 | err = mmc_sd_resume(host); | 1153 | err = mmc_sd_resume(host); |
1164 | if (err) | 1154 | if (err) |
1165 | pr_err("%s: error %d doing aggessive resume\n", | 1155 | pr_err("%s: error %d doing aggessive resume\n", |
1166 | mmc_hostname(host), err); | 1156 | mmc_hostname(host), err); |
1167 | 1157 | ||
1168 | mmc_release_host(host); | ||
1169 | return 0; | 1158 | return 0; |
1170 | } | 1159 | } |
1171 | 1160 | ||