diff options
author | Rui Miguel Silva <rui.silva@linaro.org> | 2015-10-08 12:10:52 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-10-09 14:02:06 -0700 |
commit | 6cac7dc3aaaef8161ac80c5980cec10427996abf (patch) | |
tree | 9f2b76acd4cda66b1c4e76bf0b3a27349da39a8e /drivers/staging/greybus/sdio.c | |
parent | greybus: sdio: add field to get_caps response (diff) | |
download | wireguard-linux-6cac7dc3aaaef8161ac80c5980cec10427996abf.tar.xz wireguard-linux-6cac7dc3aaaef8161ac80c5980cec10427996abf.zip |
greybus: sdio: fix card removable detection
In kernel versions bellow 3.15, the mmc_card_is_removable helper
function has an extra check used for a suspend/resume hack. This made
the gd_sdio_process_event to behave badly handling the module card
insert event in that versions.
So, just test bit the flag that we need, instead of using the helper
function. This way will work in all kernel versions.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/sdio.c')
-rw-r--r-- | drivers/staging/greybus/sdio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/greybus/sdio.c b/drivers/staging/greybus/sdio.c index ff68956108bf..e5e3b77a2d15 100644 --- a/drivers/staging/greybus/sdio.c +++ b/drivers/staging/greybus/sdio.c @@ -144,7 +144,7 @@ static int _gb_sdio_process_events(struct gb_sdio_host *host, u8 event) u8 state_changed = 0; if (event & GB_SDIO_CARD_INSERTED) { - if (!mmc_card_is_removable(host->mmc)) + if (host->mmc->caps & MMC_CAP_NONREMOVABLE) return 0; if (host->card_present) return 0; @@ -153,7 +153,7 @@ static int _gb_sdio_process_events(struct gb_sdio_host *host, u8 event) } if (event & GB_SDIO_CARD_REMOVED) { - if (!mmc_card_is_removable(host->mmc)) + if (host->mmc->caps & MMC_CAP_NONREMOVABLE) return 0; if (!(host->card_present)) return 0; |