diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-01-18 12:47:04 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-01-20 10:53:30 +0100 |
commit | 096789bc2af53f0f28f285aa0a88d5e9d05d3316 (patch) | |
tree | 2a6b13debdc9db16568f4e58cdbed47e6eff0c1c /drivers/mci | |
parent | c94cd71bb4846310cc6258f668644f3c8dffa698 (diff) | |
download | barebox-096789bc2af53f0f28f285aa0a88d5e9d05d3316.tar.gz barebox-096789bc2af53f0f28f285aa0a88d5e9d05d3316.tar.xz |
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 <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mci')
-rw-r--r-- | drivers/mci/mci-core.c | 5 |
1 files changed, 5 insertions, 0 deletions
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) { |