mmc: Do not call get_cd for non removable cards
authorSascha Hauer <s.hauer@pengutronix.de>
Thu, 5 Dec 2013 13:34:46 +0000 (14:34 +0100)
committerChris Ball <chris@printf.net>
Mon, 13 Jan 2014 17:48:17 +0000 (12:48 -0500)
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>
drivers/mmc/core/core.c

index 57a2b403bf8e9107204c3cda03671a5a1c8bd87d..098374b1ab2b99cb769d7ddf6a2a9d0a2a7672cb 100644 (file)
@@ -2460,7 +2460,8 @@ void mmc_rescan(struct work_struct *work)
         */
        mmc_bus_put(host);
 
-       if (host->ops->get_cd && host->ops->get_cd(host) == 0) {
+       if (!(host->caps & MMC_CAP_NONREMOVABLE) && host->ops->get_cd &&
+                       host->ops->get_cd(host) == 0) {
                mmc_claim_host(host);
                mmc_power_off(host);
                mmc_release_host(host);