diff mbox

sdhci: sepearate get_ro into code that calls platform and helper

Message ID A8DEF24B-343B-4ED8-B556-12E3550506A9@marvell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Philip Rakity Sept. 26, 2010, 12:43 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 0774dad..6f2bc4b 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1204,7 +1204,7 @@  out:
 	spin_unlock_irqrestore(&host->lock, flags);
 }
 
-static int sdhci_get_ro(struct mmc_host *mmc)
+int sdhci_get_ro_helper(struct mmc_host *mmc)
 {
 	struct sdhci_host *host;
 	unsigned long flags;
@@ -1226,6 +1226,18 @@  static int sdhci_get_ro(struct mmc_host *mmc)
 	return !(present & SDHCI_WRITE_PROTECT);
 }
 
+int sdhci_get_ro(struct mmc_host *mmc)
+{
+	struct sdhci_host *host;
+
+	host = mmc_priv(mmc);
+
+	if (host->ops->get_ro)
+		return host->ops->get_ro(mmc);
+	else
+		return sdhci_get_ro_helper(mmc);
+}
+
 static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable)
 {
 	struct sdhci_host *host;
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index f68af47..bd1fa15 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -324,6 +324,7 @@  struct sdhci_ops {
 	unsigned int	(*get_min_clock)(struct sdhci_host *host);
 	unsigned int	(*get_timeout_clock)(struct sdhci_host *host);
 	void	(*platform_specific_reset)(struct sdhci_host *host, u8 mask);
+	int	(*get_ro)(struct mmc_host *mmc);
 };
 
 #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS