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

mmc: Do not call get_cd for non removable cards

Non removable cards are always present, so do not call get_cd for them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>

authored by

Sascha Hauer and committed by
Chris Ball
c1b55bfc 07c001c1

+2 -1
+2 -1
drivers/mmc/core/core.c
··· 2460 2460 */ 2461 2461 mmc_bus_put(host); 2462 2462 2463 - if (host->ops->get_cd && host->ops->get_cd(host) == 0) { 2463 + if (!(host->caps & MMC_CAP_NONREMOVABLE) && host->ops->get_cd && 2464 + host->ops->get_cd(host) == 0) { 2464 2465 mmc_claim_host(host); 2465 2466 mmc_power_off(host); 2466 2467 mmc_release_host(host);