From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatolij Gustschin Subject: [PATCH 2/5] mmc: mxcmmc: use slot-gpio API for write-protect detection Date: Thu, 14 Mar 2013 17:40:50 +0100 Message-ID: <1363279254-22351-3-git-send-email-agust@denx.de> References: <1363279254-22351-1-git-send-email-agust@denx.de> Return-path: In-Reply-To: <1363279254-22351-1-git-send-email-agust@denx.de> Sender: linux-mmc-owner@vger.kernel.org To: linux-mmc@vger.kernel.org Cc: Chris Ball , Sascha Hauer , Markus Pargmann , devicetree-discuss@lists.ozlabs.org, Anatolij Gustschin List-Id: devicetree@vger.kernel.org slot-gpio API suppors read-only detection when "wp-gpios" property is present in the device tree mmc node. Use this API for write-protect detection. Signed-off-by: Anatolij Gustschin --- drivers/mmc/host/mxcmmc.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index 562f4e6..dc25802 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -943,10 +944,11 @@ static int mxcmci_get_ro(struct mmc_host *mmc) if (host->pdata && host->pdata->get_ro) return !!host->pdata->get_ro(mmc_dev(mmc)); /* - * Board doesn't support read only detection; let the mmc core - * decide what to do. + * If board doesn't support read only detection (no mmc_gpio + * context or gpio is invalid), then let the mmc core decide + * what to do. */ - return -ENOSYS; + return mmc_gpio_get_ro(mmc); } static void mxcmci_enable_sdio_irq(struct mmc_host *mmc, int enable) -- 1.7.5.4