aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmc
diff options
context:
space:
mode:
authorMatt Fleming <matt@console-pimps.org>2010-09-27 04:42:19 -0400
committerChris Ball <cjb@laptop.org>2010-10-23 09:11:15 -0400
commit71d7d3d190fe77588269a8febf93cd739bd91eb3 (patch)
tree32aa0d033c40c38327a704e2cad0fc61e2dd86ae /include/linux/mmc
parentd3c502b84f734b36abdc9d11ec61f00016e98d33 (diff)
mmc: Add helper function to check if a card is removable
There are two checks that need to be made when determining whether a card is removable. A host controller may set MMC_CAP_NONREMOVABLE if the controller does not support removing cards (e.g. eMMC), in which case the card is physically non-removable. Also the 'mmc_assume_removable' module parameter can be configured at module load time, in which case the card may be logically non-removable. A helper function keeps the logic in one place so that code always checks both conditions. Because this new function is likely to be called from modules we now need to export the mmc_assume_removable symbol. Signed-off-by: Matt Fleming <matt@console-pimps.org> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Tested-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'include/linux/mmc')
-rw-r--r--include/linux/mmc/host.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index ded401703762..2e0fe623df90 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -267,5 +267,13 @@ static inline void mmc_set_disable_delay(struct mmc_host *host,
267 host->disable_delay = disable_delay; 267 host->disable_delay = disable_delay;
268} 268}
269 269
270/* Module parameter */
271extern int mmc_assume_removable;
272
273static inline int mmc_card_is_removable(struct mmc_host *host)
274{
275 return !(host->caps & MMC_CAP_NONREMOVABLE) && mmc_assume_removable;
276}
277
270#endif 278#endif
271 279