Commit 6cac7dc3 authored by Rui Miguel Silva's avatar Rui Miguel Silva Committed by Greg Kroah-Hartman

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: default avatarRui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent e0f875c3
...@@ -144,7 +144,7 @@ static int _gb_sdio_process_events(struct gb_sdio_host *host, u8 event) ...@@ -144,7 +144,7 @@ static int _gb_sdio_process_events(struct gb_sdio_host *host, u8 event)
u8 state_changed = 0; u8 state_changed = 0;
if (event & GB_SDIO_CARD_INSERTED) { if (event & GB_SDIO_CARD_INSERTED) {
if (!mmc_card_is_removable(host->mmc)) if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
return 0; return 0;
if (host->card_present) if (host->card_present)
return 0; return 0;
...@@ -153,7 +153,7 @@ static int _gb_sdio_process_events(struct gb_sdio_host *host, u8 event) ...@@ -153,7 +153,7 @@ static int _gb_sdio_process_events(struct gb_sdio_host *host, u8 event)
} }
if (event & GB_SDIO_CARD_REMOVED) { if (event & GB_SDIO_CARD_REMOVED) {
if (!mmc_card_is_removable(host->mmc)) if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
return 0; return 0;
if (!(host->card_present)) if (!(host->card_present))
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment