Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218992
b: refs/heads/master
c: 71d7d3d
h: refs/heads/master
v: v3
  • Loading branch information
Matt Fleming authored and Chris Ball committed Oct 23, 2010
1 parent 1ebc48c commit 9bb08f0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3c502b84f734b36abdc9d11ec61f00016e98d33
refs/heads/master: 71d7d3d190fe77588269a8febf93cd739bd91eb3
1 change: 1 addition & 0 deletions trunk/drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ int mmc_assume_removable;
#else
int mmc_assume_removable = 1;
#endif
EXPORT_SYMBOL(mmc_assume_removable);
module_param_named(removable, mmc_assume_removable, bool, 0644);
MODULE_PARM_DESC(
removable,
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/mmc/core/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr);

/* Module parameters */
extern int use_spi_crc;
extern int mmc_assume_removable;

/* Debugfs information for hosts and cards */
void mmc_add_host_debugfs(struct mmc_host *host);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/mmc/core/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ static void mmc_attach_bus_ops(struct mmc_host *host)
{
const struct mmc_bus_ops *bus_ops;

if (host->caps & MMC_CAP_NONREMOVABLE || !mmc_assume_removable)
if (!mmc_card_is_removable(host))
bus_ops = &mmc_ops_unsafe;
else
bus_ops = &mmc_ops;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/mmc/core/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ static void mmc_sd_attach_bus_ops(struct mmc_host *host)
{
const struct mmc_bus_ops *bus_ops;

if (host->caps & MMC_CAP_NONREMOVABLE || !mmc_assume_removable)
if (!mmc_card_is_removable(host))
bus_ops = &mmc_sd_ops_unsafe;
else
bus_ops = &mmc_sd_ops;
Expand Down
8 changes: 8 additions & 0 deletions trunk/include/linux/mmc/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,5 +267,13 @@ static inline void mmc_set_disable_delay(struct mmc_host *host,
host->disable_delay = disable_delay;
}

/* Module parameter */
extern int mmc_assume_removable;

static inline int mmc_card_is_removable(struct mmc_host *host)
{
return !(host->caps & MMC_CAP_NONREMOVABLE) && mmc_assume_removable;
}

#endif

0 comments on commit 9bb08f0

Please sign in to comment.