Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755571AbYHKWmR (ORCPT ); Mon, 11 Aug 2008 18:42:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752264AbYHKWmF (ORCPT ); Mon, 11 Aug 2008 18:42:05 -0400 Received: from aeryn.fluff.org.uk ([87.194.8.8]:52665 "EHLO kira.home.fluff.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752036AbYHKWmE (ORCPT ); Mon, 11 Aug 2008 18:42:04 -0400 Subject: MMC: s3cmci: wirte get_cd host ops Message-Id: <20080811224200.522806334@fluff.org.uk> User-Agent: quilt/0.46-1 From: Ben Dooks To: drzeus-mmc@drzeus.cx, linux-kernel@vger.kernel.org Cc: Ben Dooks Content-Disposition: inline; filename=simtec/simtec-mmc-fix-card-detect.patch Date: Mon, 11 Aug 2008 23:42:00 +0100 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1737 Lines: 48 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 Index: linux-2.6.27-rc2-quilt3/drivers/mmc/host/s3cmci.c =================================================================== --- linux-2.6.27-rc2-quilt3.orig/drivers/mmc/host/s3cmci.c 2008-08-11 23:33:09.000000000 +0100 +++ linux-2.6.27-rc2-quilt3/drivers/mmc/host/s3cmci.c 2008-08-11 23:39:33.000000000 +0100 @@ -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 = { -- Ben (ben@fluff.org, http://www.fluff.org/) 'a smiley only costs 4 bytes' -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/