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)
committerlintao <lintao@rock-chips.com>
Fri, 7 Mar 2014 11:38:29 +0000 (19:38 +0800)
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 656b5da289e3be5dab34a094010286d818826330..51e288cdbb26aa9b4e41aaf0f03da2a2be344684 100644 (file)
@@ -2505,7 +2505,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);