diff options
author | Brian Norris <computersforpeace@gmail.com> | 2014-11-05 13:29:03 +0300 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-12-01 11:19:03 +0300 |
commit | 05241aead9b98c28476f74e7e1c5ce480ef40ac1 (patch) | |
tree | bdd35583b62faa1896af2ab0121d0fdb92137f5e /drivers/mtd/devices | |
parent | 6d7604e517bc00a36ebf7ffb4973fb72823be18c (diff) | |
download | linux-05241aead9b98c28476f74e7e1c5ce480ef40ac1.tar.xz |
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/devices')
-rw-r--r-- | drivers/mtd/devices/m25p80.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index f5cb8d57bbd1..85e35467fba6 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -157,16 +157,10 @@ static int m25p80_read(struct spi_nor *nor, loff_t from, size_t len, static int m25p80_erase(struct spi_nor *nor, loff_t offset) { struct m25p *flash = nor->priv; - int ret; dev_dbg(nor->dev, "%dKiB at 0x%08x\n", flash->mtd.erasesize / 1024, (u32)offset); - /* Send write enable, then erase commands. */ - ret = nor->write_reg(nor, SPINOR_OP_WREN, NULL, 0, 0); - if (ret) - return ret; - /* Set up command buffer. */ flash->command[0] = nor->erase_opcode; m25p_addr2cmd(nor, offset, flash->command); |