[linux-yocto] [PATCH 3/8] mmc: sdhci: Allow override of get_cd() called from sdhci_request()

Lim Key Seong key.seong.lim at intel.com
Thu Jun 9 23:21:38 PDT 2016

From: Adrian Hunter <adrian.hunter at intel.com>

Drivers may need to provide their own get_cd() mmc host op, but
currently the internals of the current op (sdhci_get_cd()) are
provided by sdhci_do_get_cd() which is also called from

To allow override of the get_cd functionality, change sdhci_request()
to call ->get_cd() instead of sdhci_do_get_cd().

Note, in the future the call to ->get_cd() will likely be removed
from sdhci_request() since most drivers don't need actually it.
However this change is being done now to facilitate a subsequent
bug fix.

Signed-off-by: Adrian Hunter <adrian.hunter at intel.com>
Cc: stable at vger.kernel.org # v4.4+
Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
(cherry picked from commit 8d28b7a72fe18bcdcdb047243ba8fec36b149955)
Signed-off-by: Lim Key Seong <key.seong.lim at intel.com>
 drivers/mmc/host/sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index a6b7424..265c303 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1367,7 +1367,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 	/* Firstly check card presence */
-	present = sdhci_do_get_cd(host);
+	present = mmc->ops->get_cd(mmc);
 	spin_lock_irqsave(&host->lock, flags);

More information about the linux-yocto mailing list