aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/core.h
diff options
context:
space:
mode:
authorNicolas Pitre <nico@fluxnic.net>2009-09-22 16:45:29 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 07:39:38 -0700
commit95cdfb72b9bc568803f395c266152c71b034b461 (patch)
treeba4d10ee9eb595398d14cf44b433b82ea7802996 /drivers/mmc/core/core.h
parentmmc: core SDIO suspend/resume support (diff)
downloadlinux-dev-95cdfb72b9bc568803f395c266152c71b034b461.tar.xz
linux-dev-95cdfb72b9bc568803f395c266152c71b034b461.zip
mmc: propagate error codes back from bus drivers' suspend/resume methods
Especially for SDIO drivers which may have special conditions/errors to report, it is a good thing to relay the returned error code back to upper layers. This also allows for the rationalization of the resume path where code to "remove" a no-longer-existing or replaced card was duplicated into the MMC, SD and SDIO bus drivers. In the SDIO case, if a function suspend method returns an error, then all previously suspended functions are resumed and the error returned. An exception is made for -ENOSYS which the core interprets as "we don't support suspend so just kick the card out for suspend and return success". When resuming SDIO cards, the core code only validates the manufacturer and product IDs to make sure the same kind of card is still present before invoking functions resume methods. It's the function driver's responsibility to perform further tests to confirm that the actual same card is present (same MAC address, etc.) and return an error otherwise. Signed-off-by: Nicolas Pitre <nico@marvell.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mmc/core/core.h')
-rw-r--r--drivers/mmc/core/core.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index c386348f5f73..67ae6abc4230 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -20,8 +20,8 @@ struct mmc_bus_ops {
int (*sleep)(struct mmc_host *);
void (*remove)(struct mmc_host *);
void (*detect)(struct mmc_host *);
- void (*suspend)(struct mmc_host *);
- void (*resume)(struct mmc_host *);
+ int (*suspend)(struct mmc_host *);
+ int (*resume)(struct mmc_host *);
void (*power_save)(struct mmc_host *);
void (*power_restore)(struct mmc_host *);
};