diff options
author | Ohad Ben-Cohen <ohad@wizery.com> | 2010-10-02 07:54:06 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2010-10-23 09:11:17 -0400 |
commit | 12ae637f081a7a05144af65802a7b492b9162660 (patch) | |
tree | 1b54043d766aaf33466f5efad08d53d16a024f85 /drivers/mmc/core/core.c | |
parent | 9b966aae6419f7d75a87114c4d82bfb8f8699132 (diff) |
mmc: propagate power save/restore ops return value
Allow power save/restore and their relevant mmc_bus_ops handlers
exit with a return value.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core/core.c')
-rw-r--r-- | drivers/mmc/core/core.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 3eb7a9be6d8d..8f86d702e46e 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -1583,37 +1583,45 @@ void mmc_stop_host(struct mmc_host *host) | |||
1583 | mmc_power_off(host); | 1583 | mmc_power_off(host); |
1584 | } | 1584 | } |
1585 | 1585 | ||
1586 | void mmc_power_save_host(struct mmc_host *host) | 1586 | int mmc_power_save_host(struct mmc_host *host) |
1587 | { | 1587 | { |
1588 | int ret = 0; | ||
1589 | |||
1588 | mmc_bus_get(host); | 1590 | mmc_bus_get(host); |
1589 | 1591 | ||
1590 | if (!host->bus_ops || host->bus_dead || !host->bus_ops->power_restore) { | 1592 | if (!host->bus_ops || host->bus_dead || !host->bus_ops->power_restore) { |
1591 | mmc_bus_put(host); | 1593 | mmc_bus_put(host); |
1592 | return; | 1594 | return -EINVAL; |
1593 | } | 1595 | } |
1594 | 1596 | ||
1595 | if (host->bus_ops->power_save) | 1597 | if (host->bus_ops->power_save) |
1596 | host->bus_ops->power_save(host); | 1598 | ret = host->bus_ops->power_save(host); |
1597 | 1599 | ||
1598 | mmc_bus_put(host); | 1600 | mmc_bus_put(host); |
1599 | 1601 | ||
1600 | mmc_power_off(host); | 1602 | mmc_power_off(host); |
1603 | |||
1604 | return ret; | ||
1601 | } | 1605 | } |
1602 | EXPORT_SYMBOL(mmc_power_save_host); | 1606 | EXPORT_SYMBOL(mmc_power_save_host); |
1603 | 1607 | ||
1604 | void mmc_power_restore_host(struct mmc_host *host) | 1608 | int mmc_power_restore_host(struct mmc_host *host) |
1605 | { | 1609 | { |
1610 | int ret; | ||
1611 | |||
1606 | mmc_bus_get(host); | 1612 | mmc_bus_get(host); |
1607 | 1613 | ||
1608 | if (!host->bus_ops || host->bus_dead || !host->bus_ops->power_restore) { | 1614 | if (!host->bus_ops || host->bus_dead || !host->bus_ops->power_restore) { |
1609 | mmc_bus_put(host); | 1615 | mmc_bus_put(host); |
1610 | return; | 1616 | return -EINVAL; |
1611 | } | 1617 | } |
1612 | 1618 | ||
1613 | mmc_power_up(host); | 1619 | mmc_power_up(host); |
1614 | host->bus_ops->power_restore(host); | 1620 | ret = host->bus_ops->power_restore(host); |
1615 | 1621 | ||
1616 | mmc_bus_put(host); | 1622 | mmc_bus_put(host); |
1623 | |||
1624 | return ret; | ||
1617 | } | 1625 | } |
1618 | EXPORT_SYMBOL(mmc_power_restore_host); | 1626 | EXPORT_SYMBOL(mmc_power_restore_host); |
1619 | 1627 | ||