diff options
Diffstat (limited to 'drivers/mmc/core/core.c')
-rw-r--r-- | drivers/mmc/core/core.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 01ced4c5a61d..ede5d1e2e20d 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -638,6 +638,9 @@ void mmc_rescan(struct work_struct *work) | |||
638 | */ | 638 | */ |
639 | mmc_bus_put(host); | 639 | mmc_bus_put(host); |
640 | 640 | ||
641 | if (host->ops->get_cd && host->ops->get_cd(host) == 0) | ||
642 | goto out; | ||
643 | |||
641 | mmc_claim_host(host); | 644 | mmc_claim_host(host); |
642 | 645 | ||
643 | mmc_power_up(host); | 646 | mmc_power_up(host); |
@@ -652,7 +655,7 @@ void mmc_rescan(struct work_struct *work) | |||
652 | if (!err) { | 655 | if (!err) { |
653 | if (mmc_attach_sdio(host, ocr)) | 656 | if (mmc_attach_sdio(host, ocr)) |
654 | mmc_power_off(host); | 657 | mmc_power_off(host); |
655 | return; | 658 | goto out; |
656 | } | 659 | } |
657 | 660 | ||
658 | /* | 661 | /* |
@@ -662,7 +665,7 @@ void mmc_rescan(struct work_struct *work) | |||
662 | if (!err) { | 665 | if (!err) { |
663 | if (mmc_attach_sd(host, ocr)) | 666 | if (mmc_attach_sd(host, ocr)) |
664 | mmc_power_off(host); | 667 | mmc_power_off(host); |
665 | return; | 668 | goto out; |
666 | } | 669 | } |
667 | 670 | ||
668 | /* | 671 | /* |
@@ -672,7 +675,7 @@ void mmc_rescan(struct work_struct *work) | |||
672 | if (!err) { | 675 | if (!err) { |
673 | if (mmc_attach_mmc(host, ocr)) | 676 | if (mmc_attach_mmc(host, ocr)) |
674 | mmc_power_off(host); | 677 | mmc_power_off(host); |
675 | return; | 678 | goto out; |
676 | } | 679 | } |
677 | 680 | ||
678 | mmc_release_host(host); | 681 | mmc_release_host(host); |
@@ -683,6 +686,9 @@ void mmc_rescan(struct work_struct *work) | |||
683 | 686 | ||
684 | mmc_bus_put(host); | 687 | mmc_bus_put(host); |
685 | } | 688 | } |
689 | out: | ||
690 | if (host->caps & MMC_CAP_NEEDS_POLL) | ||
691 | mmc_schedule_delayed_work(&host->detect, HZ); | ||
686 | } | 692 | } |
687 | 693 | ||
688 | void mmc_start_host(struct mmc_host *host) | 694 | void mmc_start_host(struct mmc_host *host) |