aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2013-10-30 18:15:30 -0400
committerChris Ball <chris@printf.net>2014-02-13 22:58:23 -0500
commit5601aaf73e5c2f0aa5e3607fee7b7d3511edfea9 (patch)
treeb470dc3ea16a426d72d9c7938a71daaf813b67b0
parent2501c9179dff2add6aadd3898cd729e94e777d3a (diff)
mmc: core: Remove unnecessary validations for bus_ops callbacks
Due to the removal of the Kconfig option MMC_UNSAFE_RESUME, several validations of a present bus_ops callback became redundant. Let's remove these. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <chris@printf.net>
-rw-r--r--drivers/mmc/core/bus.c12
-rw-r--r--drivers/mmc/core/core.c13
2 files changed, 7 insertions, 18 deletions
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 64145a32b917..824644875d41 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -185,24 +185,16 @@ static int mmc_runtime_suspend(struct device *dev)
185{ 185{
186 struct mmc_card *card = mmc_dev_to_card(dev); 186 struct mmc_card *card = mmc_dev_to_card(dev);
187 struct mmc_host *host = card->host; 187 struct mmc_host *host = card->host;
188 int ret = 0;
189 188
190 if (host->bus_ops->runtime_suspend) 189 return host->bus_ops->runtime_suspend(host);
191 ret = host->bus_ops->runtime_suspend(host);
192
193 return ret;
194} 190}
195 191
196static int mmc_runtime_resume(struct device *dev) 192static int mmc_runtime_resume(struct device *dev)
197{ 193{
198 struct mmc_card *card = mmc_dev_to_card(dev); 194 struct mmc_card *card = mmc_dev_to_card(dev);
199 struct mmc_host *host = card->host; 195 struct mmc_host *host = card->host;
200 int ret = 0;
201 196
202 if (host->bus_ops->runtime_resume) 197 return host->bus_ops->runtime_resume(host);
203 ret = host->bus_ops->runtime_resume(host);
204
205 return ret;
206} 198}
207 199
208static int mmc_runtime_idle(struct device *dev) 200static int mmc_runtime_idle(struct device *dev)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 10856ec64412..22427c684b36 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2231,9 +2231,6 @@ static int mmc_do_hw_reset(struct mmc_host *host, int check)
2231{ 2231{
2232 struct mmc_card *card = host->card; 2232 struct mmc_card *card = host->card;
2233 2233
2234 if (!host->bus_ops->power_restore)
2235 return -EOPNOTSUPP;
2236
2237 if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset) 2234 if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset)
2238 return -EOPNOTSUPP; 2235 return -EOPNOTSUPP;
2239 2236
@@ -2335,7 +2332,7 @@ int _mmc_detect_card_removed(struct mmc_host *host)
2335{ 2332{
2336 int ret; 2333 int ret;
2337 2334
2338 if ((host->caps & MMC_CAP_NONREMOVABLE) || !host->bus_ops->alive) 2335 if (host->caps & MMC_CAP_NONREMOVABLE)
2339 return 0; 2336 return 0;
2340 2337
2341 if (!host->card || mmc_card_removed(host->card)) 2338 if (!host->card || mmc_card_removed(host->card))
@@ -2418,7 +2415,7 @@ void mmc_rescan(struct work_struct *work)
2418 * if there is a _removable_ card registered, check whether it is 2415 * if there is a _removable_ card registered, check whether it is
2419 * still present 2416 * still present
2420 */ 2417 */
2421 if (host->bus_ops && host->bus_ops->detect && !host->bus_dead 2418 if (host->bus_ops && !host->bus_dead
2422 && !(host->caps & MMC_CAP_NONREMOVABLE)) 2419 && !(host->caps & MMC_CAP_NONREMOVABLE))
2423 host->bus_ops->detect(host); 2420 host->bus_ops->detect(host);
2424 2421
@@ -2520,7 +2517,7 @@ int mmc_power_save_host(struct mmc_host *host)
2520 2517
2521 mmc_bus_get(host); 2518 mmc_bus_get(host);
2522 2519
2523 if (!host->bus_ops || host->bus_dead || !host->bus_ops->power_restore) { 2520 if (!host->bus_ops || host->bus_dead) {
2524 mmc_bus_put(host); 2521 mmc_bus_put(host);
2525 return -EINVAL; 2522 return -EINVAL;
2526 } 2523 }
@@ -2546,7 +2543,7 @@ int mmc_power_restore_host(struct mmc_host *host)
2546 2543
2547 mmc_bus_get(host); 2544 mmc_bus_get(host);
2548 2545
2549 if (!host->bus_ops || host->bus_dead || !host->bus_ops->power_restore) { 2546 if (!host->bus_ops || host->bus_dead) {
2550 mmc_bus_put(host); 2547 mmc_bus_put(host);
2551 return -EINVAL; 2548 return -EINVAL;
2552 } 2549 }
@@ -2651,7 +2648,7 @@ int mmc_pm_notify(struct notifier_block *notify_block,
2651 /* Validate prerequisites for suspend */ 2648 /* Validate prerequisites for suspend */
2652 if (host->bus_ops->pre_suspend) 2649 if (host->bus_ops->pre_suspend)
2653 err = host->bus_ops->pre_suspend(host); 2650 err = host->bus_ops->pre_suspend(host);
2654 if (!err && host->bus_ops->suspend) 2651 if (!err)
2655 break; 2652 break;
2656 2653
2657 /* Calling bus_ops->remove() with a claimed host can deadlock */ 2654 /* Calling bus_ops->remove() with a claimed host can deadlock */