Skip to content

Commit

Permalink
s3cmci: attach get_cd host ops
Browse files Browse the repository at this point in the history
Attach the routine to get_cd to allow the MMC core to find out whether
there is a card present or not without the tedious process of trying to
send commands to the card or not.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
  • Loading branch information
Ben Dooks authored and Pierre Ossman committed Aug 17, 2008
1 parent 5d30440 commit 87dd980
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/mmc/host/s3cmci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,8 +1004,9 @@ static void s3cmci_send_request(struct mmc_host *mmc)
enable_irq(host->irq);
}

static int s3cmci_card_present(struct s3cmci_host *host)
static int s3cmci_card_present(struct mmc_host *mmc)
{
struct s3cmci_host *host = mmc_priv(mmc);
struct s3c24xx_mci_pdata *pdata = host->pdata;
int ret;

Expand All @@ -1024,7 +1025,7 @@ static void s3cmci_request(struct mmc_host *mmc, struct mmc_request *mrq)
host->cmd_is_stop = 0;
host->mrq = mrq;

if (s3cmci_card_present(host) == 0) {
if (s3cmci_card_present(mmc) == 0) {
dbg(host, dbg_err, "%s: no medium present\n", __func__);
host->mrq->cmd->error = -ENOMEDIUM;
mmc_request_done(mmc, mrq);
Expand Down Expand Up @@ -1139,6 +1140,7 @@ static struct mmc_host_ops s3cmci_ops = {
.request = s3cmci_request,
.set_ios = s3cmci_set_ios,
.get_ro = s3cmci_get_ro,
.get_cd = s3cmci_card_present,
};

static struct s3c24xx_mci_pdata s3cmci_def_pdata = {
Expand Down

0 comments on commit 87dd980

Please sign in to comment.