static int macronix_set_4byte(struct spi_nor *nor, bool enable)
{
if (nor->spimem) {
-@@ -1259,6 +1275,10 @@ static int spi_nor_erase(struct mtd_info
+@@ -1261,6 +1277,10 @@ static int spi_nor_erase(struct mtd_info
if (ret)
return ret;
/* whole-chip erase? */
if (len == mtd->size && !(nor->flags & SNOR_F_NO_OP_CHIP_ERASE)) {
unsigned long timeout;
-@@ -1315,6 +1335,7 @@ static int spi_nor_erase(struct mtd_info
+@@ -1317,6 +1337,7 @@ static int spi_nor_erase(struct mtd_info
write_disable(nor);
erase_err:
spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_ERASE);
return ret;
-@@ -1621,7 +1642,9 @@ static int spi_nor_lock(struct mtd_info
+@@ -1623,7 +1644,9 @@ static int spi_nor_lock(struct mtd_info
if (ret)
return ret;
spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_UNLOCK);
return ret;
-@@ -1636,7 +1659,9 @@ static int spi_nor_unlock(struct mtd_inf
+@@ -1638,7 +1661,9 @@ static int spi_nor_unlock(struct mtd_inf
if (ret)
return ret;
spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_LOCK);
return ret;
-@@ -1651,7 +1676,9 @@ static int spi_nor_is_locked(struct mtd_
+@@ -1653,7 +1678,9 @@ static int spi_nor_is_locked(struct mtd_
if (ret)
return ret;
spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_LOCK);
return ret;
-@@ -2557,6 +2584,10 @@ static int spi_nor_read(struct mtd_info
+@@ -2559,6 +2586,10 @@ static int spi_nor_read(struct mtd_info
if (ret)
return ret;
while (len) {
loff_t addr = from;
-@@ -2580,6 +2611,7 @@ static int spi_nor_read(struct mtd_info
+@@ -2582,6 +2613,7 @@ static int spi_nor_read(struct mtd_info
ret = 0;
read_err:
spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_READ);
return ret;
}
-@@ -2597,6 +2629,10 @@ static int sst_write(struct mtd_info *mt
+@@ -2599,6 +2631,10 @@ static int sst_write(struct mtd_info *mt
if (ret)
return ret;
write_enable(nor);
nor->sst_write_second = false;
-@@ -2659,6 +2695,7 @@ static int sst_write(struct mtd_info *mt
+@@ -2661,6 +2697,7 @@ static int sst_write(struct mtd_info *mt
}
sst_write_err:
*retlen += actual;
spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE);
return ret;
}
-@@ -2681,6 +2718,10 @@ static int spi_nor_write(struct mtd_info
+@@ -2683,6 +2720,10 @@ static int spi_nor_write(struct mtd_info
if (ret)
return ret;
for (i = 0; i < len; ) {
ssize_t written;
loff_t addr = to + i;
-@@ -2720,6 +2761,7 @@ static int spi_nor_write(struct mtd_info
+@@ -2722,6 +2763,7 @@ static int spi_nor_write(struct mtd_info
}
write_err:
spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE);
return ret;
}
-@@ -4725,9 +4767,13 @@ static int spi_nor_init(struct spi_nor *
+@@ -4726,9 +4768,13 @@ static int spi_nor_init(struct spi_nor *
* reboots (e.g., crashes). Warn the user (or hopefully, system
* designer) that this is bad.
*/