diff mbox

[2/3] mtd: m25p80: Initialize the addr_width field of spi_message

Message ID 1431269253-22890-2-git-send-email-B48286@freescale.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hou Zhiqiang May 10, 2015, 2:47 p.m. UTC
From: Hou Zhiqiang <B48286@freescale.com>

Add the addr_width information of spi_nor delivery to SPI controller.

For the Freescale eSPI controller, the address width is needed to do
the correct operations.

Signed-off-by: Hou Zhiqiang <B48286@freescale.com>
---
 drivers/mtd/devices/m25p80.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 7c8b169..0ae72a0 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -85,6 +85,7 @@  static void m25p80_write(struct spi_nor *nor, loff_t to, size_t len,
 	int cmd_sz = m25p_cmdsz(nor);
 
 	spi_message_init(&m);
+	m.addr_width = flash->spi_nor.addr_width;
 
 	if (nor->program_opcode == SPINOR_OP_AAI_WP && nor->sst_write_second)
 		cmd_sz = 1;
@@ -134,6 +135,7 @@  static int m25p80_read(struct spi_nor *nor, loff_t from, size_t len,
 	dummy /= 8;
 
 	spi_message_init(&m);
+	m.addr_width = flash->spi_nor.addr_width;
 	memset(t, 0, (sizeof t));
 
 	flash->command[0] = nor->read_opcode;