From cf6b5087944d0f70e78ee3085c2b0b27ade74d3b Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 13 Jan 2017 15:31:23 +0100 Subject: mci: imx-esdhci: remove wrong write protection test Testing for the write protection bit to determine if a card is write protected or not is wrong. The bit may have the wrong value for permanently plugged cards (eMMC) or for boards using a GPIO for write protection detection. Since the core will test for write protection before actually calling into the driver this test can just be removed. Signed-off-by: Sascha Hauer --- drivers/mci/imx-esdhc.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c index 19d11a5a33..b2961cce3a 100644 --- a/drivers/mci/imx-esdhc.c +++ b/drivers/mci/imx-esdhc.c @@ -218,13 +218,10 @@ static int esdhc_setup_data(struct mci_host *mci, struct mci_data *data) u32 wml_value; if (IS_ENABLED(CONFIG_MCI_IMX_ESDHC_PIO)) { - if (!(data->flags & MMC_DATA_READ)) { - if ((esdhc_read32(regs + SDHCI_PRESENT_STATE) & PRSSTAT_WPSPL) == 0) - goto err_locked; + if (!(data->flags & MMC_DATA_READ)) esdhc_write32(regs + SDHCI_DMA_ADDRESS, (u32)data->src); - } else { + else esdhc_write32(regs + SDHCI_DMA_ADDRESS, (u32)data->dest); - } } else { wml_value = data->blocksize/4; @@ -237,8 +234,6 @@ static int esdhc_setup_data(struct mci_host *mci, struct mci_data *data) } else { if (wml_value > 0x80) wml_value = 0x80; - if ((esdhc_read32(regs + SDHCI_PRESENT_STATE) & PRSSTAT_WPSPL) == 0) - goto err_locked; esdhc_clrsetbits32(regs + IMX_SDHCI_WML, WML_WR_WML_MASK, wml_value << 16); @@ -249,11 +244,6 @@ static int esdhc_setup_data(struct mci_host *mci, struct mci_data *data) esdhc_write32(regs + SDHCI_BLOCK_SIZE__BLOCK_COUNT, data->blocks << 16 | data->blocksize); return 0; - -err_locked: - dev_err(host->dev, "Can not write to locked card.\n\n"); - - return -ETIMEDOUT; } static int esdhc_do_data(struct mci_host *mci, struct mci_data *data) -- cgit v1.2.3