Skip to contentSkip to conversation

mtd: m25p80: handle failed spi_write in m25p80_erase

PATCH Applied Heiner Kallweit 1 participant 1 message Nov 17, 2015 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 mtd: m25p80: handle failed spi_write in m25p80_erase

Handle the case that spi_write fails.

---
 drivers/mtd/devices/m25p80.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mtd/devices/m25p80.c +1 -3
index 634b0c4..f10daa8 100644
@@ -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.2