summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/spi-nor/fsl-quadspi.c
diff options
context:
space:
mode:
authorBrian Norris2014-11-05 11:29:03 +0100
committerBrian Norris2014-12-01 09:19:03 +0100
commit05241aead9b98c28476f74e7e1c5ce480ef40ac1 (patch)
treebdd35583b62faa1896af2ab0121d0fdb92137f5e /drivers/mtd/spi-nor/fsl-quadspi.c
parentmtd: spi-nor: add support for s25fl128s (diff)
downloadkernel-qcow2-linux-05241aead9b98c28476f74e7e1c5ce480ef40ac1.tar.gz
kernel-qcow2-linux-05241aead9b98c28476f74e7e1c5ce480ef40ac1.tar.xz
kernel-qcow2-linux-05241aead9b98c28476f74e7e1c5ce480ef40ac1.zip
mtd: spi-nor: factor out write_enable() for erase commands
write_enable() was being duplicated to both m25p80.c and fsl-quadspi.c. But this should be handled within the spi-nor abstraction layer. At the same time, let's add write_disable() after erasing, so we don't leave the flash in a write-enabled state afterward. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Huang Shijie <shijie.huang@intel.com>
Diffstat (limited to 'drivers/mtd/spi-nor/fsl-quadspi.c')
-rw-r--r--drivers/mtd/spi-nor/fsl-quadspi.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
index 03dcffac8185..7f2ba8d946b5 100644
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -738,11 +738,6 @@ static int fsl_qspi_erase(struct spi_nor *nor, loff_t offs)
dev_dbg(nor->dev, "%dKiB at 0x%08x:0x%08x\n",
nor->mtd->erasesize / 1024, q->chip_base_addr, (u32)offs);
- /* Send write enable, then erase commands. */
- ret = nor->write_reg(nor, SPINOR_OP_WREN, NULL, 0, 0);
- if (ret)
- return ret;
-
ret = fsl_qspi_runcmd(q, nor->erase_opcode, offs, 0);
if (ret)
return ret;