mtd: m25p80: drop wait-till-ready checks

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Dec 15 19:59:05 PST 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=6af91949ab7462d0917f436820c263ae9a89322c
Commit:     6af91949ab7462d0917f436820c263ae9a89322c
Parent:     dfa9c0cba4ea20e766bbb4f89152b05d00ab9ab3
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Wed Aug 6 18:16:58 2014 -0700
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed Nov 5 02:08:20 2014 -0800

    mtd: m25p80: drop wait-till-ready checks
    
    spi-nor.c should be taking care of these now.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Reviewed-by: Marek Vasut <marex at denx.de>
---
 drivers/mtd/devices/m25p80.c | 11 -----------
 include/linux/mtd/spi-nor.h  |  6 ++++++
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 5d44825..35e7e98 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -129,16 +129,10 @@ static int m25p80_read(struct spi_nor *nor, loff_t from, size_t len,
 	struct spi_transfer t[2];
 	struct spi_message m;
 	unsigned int dummy = nor->read_dummy;
-	int ret;
 
 	/* convert the dummy cycles to the number of bytes */
 	dummy /= 8;
 
-	/* Wait till previous write/erase is done. */
-	ret = nor->wait_till_ready(nor);
-	if (ret)
-		return ret;
-
 	spi_message_init(&m);
 	memset(t, 0, (sizeof t));
 
@@ -168,11 +162,6 @@ static int m25p80_erase(struct spi_nor *nor, loff_t offset)
 	dev_dbg(nor->dev, "%dKiB at 0x%08x\n",
 		flash->mtd.erasesize / 1024, (u32)offset);
 
-	/* Wait until finished previous write command. */
-	ret = nor->wait_till_ready(nor);
-	if (ret)
-		return ret;
-
 	/* Send write enable, then erase commands. */
 	ret = nor->write_reg(nor, SPINOR_OP_WREN, NULL, 0, 0);
 	if (ret)
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
index 2f27713..d691025 100644
--- a/include/linux/mtd/spi-nor.h
+++ b/include/linux/mtd/spi-nor.h
@@ -116,6 +116,10 @@ enum spi_nor_ops {
 	SPI_NOR_OPS_UNLOCK,
 };
 
+enum spi_nor_option_flags {
+	SNOR_F_USE_FSR		= BIT(0),
+};
+
 /**
  * struct spi_nor - Structure for defining a the SPI NOR layer
  * @mtd:		point to a mtd_info structure
@@ -129,6 +133,7 @@ enum spi_nor_ops {
  * @program_opcode:	the program opcode
  * @flash_read:		the mode of the read
  * @sst_write_second:	used by the SST write operation
+ * @flags:		flag options for the current SPI-NOR (SNOR_F_*)
  * @cfg:		used by the read_xfer/write_xfer
  * @cmd_buf:		used by the write_reg
  * @prepare:		[OPTIONAL] do some preparations for the
@@ -158,6 +163,7 @@ struct spi_nor {
 	u8			program_opcode;
 	enum read_mode		flash_read;
 	bool			sst_write_second;
+	u32			flags;
 	struct spi_nor_xfer_cfg	cfg;
 	u8			cmd_buf[SPI_NOR_MAX_CMD_SIZE];
 



More information about the linux-mtd-cvs mailing list