summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-01-13 15:31:23 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-01-19 15:21:40 +0100
commitcf6b5087944d0f70e78ee3085c2b0b27ade74d3b (patch)
tree6c440dd47012a2fe8ad275b7f429639f8d3592d0
parent6e9a87b39429c7f63627556d7e1ff6e9c5ac2b81 (diff)
downloadbarebox-cf6b5087944d0f70e78ee3085c2b0b27ade74d3b.tar.gz
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 <s.hauer@pengutronix.de>
-rw-r--r--drivers/mci/imx-esdhc.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index 19d11a5..b2961cc 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)