From: Veerabhadrarao Badiganti Date: Thu, 26 Jul 2018 12:35:31 +0000 (+0530) Subject: mmc: core: Use mmc_get_cd_gpio to get cd gpio status in resume path X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=08431ef0acd5b79259d626dc36bebef59b5a4439;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git mmc: core: Use mmc_get_cd_gpio to get cd gpio status in resume path The change a4d7728mmc(core: Update SD card removal logic based on cd- gpio state), has introduced logic to read the card presence status in resume path of mmc_pm_notify(), for forcing card detection if card is removed. But the API being used for getting gpio status invoking sleep calls from resume context which shouldn't have any sleep calls. So updated the resume path with different API for getting cd-gpio state. This chagne is not needed 4.9 kernel onwards since the there the sdhci_get_cd() API has different implementation. Change-Id: I5e7e760c6345a6fcdc873849d11f0bb32af09295 Signed-off-by: Veerabhadrarao Badiganti --- diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index e4e4e04e1d0c..76dbbbde884b 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -4572,8 +4572,8 @@ int mmc_pm_notify(struct notifier_block *notify_block, spin_lock_irqsave(&host->lock, flags); host->rescan_disable = 0; - if (host->ops->get_cd) - present = host->ops->get_cd(host); + if (mmc_card_is_removable(host)) + present = !!mmc_gpio_get_cd(host); if (mmc_bus_manual_resume(host) && !host->ignore_bus_resume_flags &&