Skip to contentSkip to conversation

MMC: s3cmci: attach get_cd host ops

PATCH Applied Ben Dooks 2 participants 2 messages Aug 12, 2008 – Aug 17, 2008 MMC, SD and SDIO

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

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.

drivers/mmc/host/s3cmci.c +4 -2
Index: linux-2.6.27-rc2-quilt3/drivers/mmc/host/s3cmci.c
===================================================================
@@ -1004,8 +1004,9 @@ static void s3cmci_send_request(struct m
 	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;
 
@@ -1024,7 +1025,7 @@ static void s3cmci_request(struct mmc_ho
 	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);
@@ -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 = {
Signature · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'
#1 lore raw
Quoted 6 lines · On Tue, 12 Aug 2008 09:24:50 +0100 Ben Dooks <[email protected]> wrote:

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.

Applied.

Signature · 9 lines
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  rdesktop, core developer          http://www.rdesktop.org

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.