From 096789bc2af53f0f28f285aa0a88d5e9d05d3316 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 18 Jan 2013 12:47:04 +0100 Subject: mci: Add card_present callback Currently there is no common way for the mci host driver to tell that there is no card present. This adds a card_present callback which is used by the framework to tell whether it's present or not. Signed-off-by: Sascha Hauer --- drivers/mci/mci-core.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/mci/mci-core.c') diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c index 7d43fe3ec3..fd052f16da 100644 --- a/drivers/mci/mci-core.c +++ b/drivers/mci/mci-core.c @@ -1352,6 +1352,11 @@ static int mci_card_probe(struct mci *mci) struct mci_host *host = mci->host; int rc, disknum; + if (host->card_present && !host->card_present(host)) { + dev_err(mci->mci_dev, "no card inserted\n"); + return -ENODEV; + } + /* start with a host interface reset */ rc = (host->init)(host, mci->mci_dev); if (rc) { -- cgit v1.2.3