diff options
author | Pierre Ossman <drzeus@drzeus.cx> | 2008-04-16 13:13:13 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2008-07-15 08:14:40 -0400 |
commit | 1e72859e3ae16346d4007024b20d2d4ef387dcc3 (patch) | |
tree | 5fc8319ce14b0770546bbbf9a72c90abaf019317 /drivers/mmc/host/sdhci.h | |
parent | 4489428ab5a49a6f443d9aa17f1d891417787d7b (diff) |
sdhci: handle hot-remove
Gracefully handle when the device is suddenly removed. Do a test read
and avoid any further access if that read returns -1.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/host/sdhci.h')
-rw-r--r-- | drivers/mmc/host/sdhci.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 7ce12f3e7452..7c302515a6a5 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h | |||
@@ -198,6 +198,7 @@ struct sdhci_host { | |||
198 | int flags; /* Host attributes */ | 198 | int flags; /* Host attributes */ |
199 | #define SDHCI_USE_DMA (1<<0) /* Host is DMA capable */ | 199 | #define SDHCI_USE_DMA (1<<0) /* Host is DMA capable */ |
200 | #define SDHCI_REQ_USE_DMA (1<<1) /* Use DMA for this req. */ | 200 | #define SDHCI_REQ_USE_DMA (1<<1) /* Use DMA for this req. */ |
201 | #define SDHCI_DEVICE_DEAD (1<<2) /* Device unresponsive */ | ||
201 | 202 | ||
202 | unsigned int max_clk; /* Max possible freq (MHz) */ | 203 | unsigned int max_clk; /* Max possible freq (MHz) */ |
203 | unsigned int timeout_clk; /* Timeout freq (KHz) */ | 204 | unsigned int timeout_clk; /* Timeout freq (KHz) */ |
@@ -239,7 +240,7 @@ static inline void *sdhci_priv(struct sdhci_host *host) | |||
239 | } | 240 | } |
240 | 241 | ||
241 | extern int sdhci_add_host(struct sdhci_host *host); | 242 | extern int sdhci_add_host(struct sdhci_host *host); |
242 | extern void sdhci_remove_host(struct sdhci_host *host); | 243 | extern void sdhci_remove_host(struct sdhci_host *host, int dead); |
243 | 244 | ||
244 | #ifdef CONFIG_PM | 245 | #ifdef CONFIG_PM |
245 | extern int sdhci_suspend_host(struct sdhci_host *host, pm_message_t state); | 246 | extern int sdhci_suspend_host(struct sdhci_host *host, pm_message_t state); |