Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: vub300: Don't use mmc_card_present() when validating for inserted card

The mmc_card_present() function helps the mmc core to track an internal
state of the card device. More importantly, it's not intended to be used by
mmc host drivers to check for an inserted card. Therefore, let's stop using
it and instead rely on checking for a valid pointer to a struct mmc_card,
as it should be good enough.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

+2 -4
+2 -4
drivers/mmc/host/vub300.c
··· 726 726 */ 727 727 } else if (vub300->card_present) { 728 728 check_vub300_port_status(vub300); 729 - } else if (vub300->mmc && vub300->mmc->card && 730 - mmc_card_present(vub300->mmc->card)) { 729 + } else if (vub300->mmc && vub300->mmc->card) { 731 730 /* 732 731 * the MMC core must not have responded 733 732 * to the previous indication - lets ··· 1753 1754 int data_length; 1754 1755 mutex_lock(&vub300->cmd_mutex); 1755 1756 init_completion(&vub300->command_complete); 1756 - if (likely(vub300->vub_name[0]) || !vub300->mmc->card || 1757 - !mmc_card_present(vub300->mmc->card)) { 1757 + if (likely(vub300->vub_name[0]) || !vub300->mmc->card) { 1758 1758 /* 1759 1759 * the name of the EMPTY Pseudo firmware file 1760 1760 * is used as a flag to indicate that the file