mtd: m25p80: handle failed spi_write in m25p80_erase
PATCH 1/1 mtd: m25p80: handle failed spi_write in m25p80_erase
Return an error if spi_write fails.
--- drivers/mtd/devices/m25p80.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mtd/devices/m25p80.c +1 -3
@@ -171,9 +171,7 @@ static int m25p80_erase(struct spi_nor *nor, loff_t offset) flash->command[0 ] = nor->erase_opcode;m25p_addr2cmd (nor, offset, flash->command); -spi_write (flash->spi, flash->command,m25p_cmdsz (nor)); - -return 0 ; +return spi_write (flash->spi, flash->command,m25p_cmdsz (nor)); }/*
Signature · 1 line
2.6.1
Quoted 12 lines · Heiner Kallweit
Return an error if
spi_writefails.Signed-off-by Heiner Kallweit <[email protected]>--- drivers/mtd/devices/m25p80.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/mtd/devices/m25p80.c +0
-0
drivers/mtd/devices/m25p80.c static int m25p80_erase(struct spi_nor *nor, loff_t offset) · line 177
Quoted 10 lines
drivers/mtd/devices/m25p80.c +1
-3@@ -171,9 +171,7 @@ static int m25p80_erase(struct spi_nor *nor, loff_t offset) flash->command[0 ] = nor->erase_opcode;m25p_addr2cmd (nor, offset, flash->command); -spi_write (flash->spi, flash->command,m25p_cmdsz (nor)); - -return 0 ; +return spi_write (flash->spi, flash->command,m25p_cmdsz (nor)); }/*
m25p80_erase() has been dropped, as it can be implemented in spi-nor.c, with calls only to ->write_reg(). This error handling is done correctly there. See:
cd78ea02dc82 ("mtd: m25p80: drop erase() callback") c67cbb839da9 ("mtd: spi-nor: provide default erase_sector implementation")
Brian
Hello,
Quoted 22 lines · Brian Norris
Quoted 21 lines · Heiner Kallweit
Return an error if
spi_writefails.Signed-off-by Heiner Kallweit <[email protected]>--- drivers/mtd/devices/m25p80.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/mtd/devices/m25p80.c +1
-3@@ -171,9 +171,7 @@ static int m25p80_erase(struct spi_nor *nor, loff_t offset) flash->command[0 ] = nor->erase_opcode;m25p_addr2cmd (nor, offset, flash->command); -spi_write (flash->spi, flash->command,m25p_cmdsz (nor)); - -return 0 ; +return spi_write (flash->spi, flash->command,m25p_cmdsz (nor)); }
Quoted 9 lines
drivers/mtd/devices/m25p80.c static int m25p80_erase(struct spi_nor *nor, loff_t offset) · line 177
Quoted 1 line
drivers/mtd/devices/m25p80.c +0
-0/*
m25p80_erase()has been dropped, as it can be implemented inspi-nor.c, with calls only to ->write_reg(). This error handling is done correctly there. See:
cd78ea02dc82("mtd: m25p80: droperase()callback")c67cbb839da9("mtd: spi-nor: provide defaulterase_sectorimplementation")
Where are these patches applied?
I wrote exact same patch as above and it still applies to Linux master.
Thanks
Michal
Quoted 31 lines · Michal Suchanek
Hello,
Quoted 28 lines · Brian Norris
Quoted 12 lines · Heiner Kallweit
Return an error if
spi_writefails.Signed-off-by Heiner Kallweit <[email protected]>--- drivers/mtd/devices/m25p80.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/mtd/devices/m25p80.c +0
-0drivers/mtd/devices/m25p80.c static int m25p80_erase(struct spi_nor *nor, loff_t offset) · line 177
Quoted 10 lines
drivers/mtd/devices/m25p80.c +1
-3@@ -171,9 +171,7 @@ static int m25p80_erase(struct spi_nor *nor, loff_t offset) flash->command[0 ] = nor->erase_opcode;m25p_addr2cmd (nor, offset, flash->command); -spi_write (flash->spi, flash->command,m25p_cmdsz (nor)); - -return 0 ; +return spi_write (flash->spi, flash->command,m25p_cmdsz (nor)); }/*
m25p80_erase()has been dropped, as it can be implemented inspi-nor.c, with calls only to ->write_reg(). This error handling is done correctly there. See:
Quoted 6 lines
Quoted 3 lines
cd78ea02dc82("mtd: m25p80: droperase()callback")c67cbb839da9("mtd: spi-nor: provide defaulterase_sectorimplementation")Where are these patches applied?
As per [1] latest MTD patches are in http://git.infradead.org/l2-mtd.git.
[1] http://www.linux-mtd.infradead.org/source.html
Signature · 2 lines
Ezequiel García, VanguardiaSur www.vanguardiasur.com.ar
Quoted 36 lines · Ezequiel Garcia
Quoted 35 lines · Michal Suchanek
Hello,
Quoted 31 lines · Brian Norris
Quoted 12 lines · Heiner Kallweit
Return an error if
spi_writefails.Signed-off-by Heiner Kallweit <[email protected]>--- drivers/mtd/devices/m25p80.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/mtd/devices/m25p80.c +0
-0drivers/mtd/devices/m25p80.c static int m25p80_erase(struct spi_nor *nor, loff_t offset) · line 177
Quoted 10 lines
drivers/mtd/devices/m25p80.c +1
-3@@ -171,9 +171,7 @@ static int m25p80_erase(struct spi_nor *nor, loff_t offset) flash->command[0 ] = nor->erase_opcode;m25p_addr2cmd (nor, offset, flash->command); -spi_write (flash->spi, flash->command,m25p_cmdsz (nor)); - -return 0 ; +return spi_write (flash->spi, flash->command,m25p_cmdsz (nor)); }/*
m25p80_erase()has been dropped, as it can be implemented inspi-nor.c, with calls only to ->write_reg(). This error handling is done correctly there. See:
cd78ea02dc82("mtd: m25p80: droperase()callback")c67cbb839da9("mtd: spi-nor: provide defaulterase_sectorimplementation")
Quoted 7 lines
Quoted 2 lines
Where are these patches applied?
As per [1] latest MTD patches are in http://git.infradead.org/l2-mtd.git.
Yes, that has those patches.
Thanks
Michal