static int macronix_set_4byte(struct spi_nor *nor, bool enable)
{
if (nor->spimem) {
-@@ -1261,6 +1277,10 @@ static int spi_nor_erase(struct mtd_info
+@@ -1263,6 +1279,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;
-@@ -1317,6 +1337,7 @@ static int spi_nor_erase(struct mtd_info
+@@ -1319,6 +1339,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;
-@@ -1623,7 +1644,9 @@ static int spi_nor_lock(struct mtd_info
+@@ -1625,7 +1646,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;
-@@ -1638,7 +1661,9 @@ static int spi_nor_unlock(struct mtd_inf
+@@ -1640,7 +1663,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;
-@@ -1653,7 +1678,9 @@ static int spi_nor_is_locked(struct mtd_
+@@ -1655,7 +1680,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;
-@@ -2560,6 +2587,10 @@ static int spi_nor_read(struct mtd_info
+@@ -2562,6 +2589,10 @@ static int spi_nor_read(struct mtd_info
if (ret)
return ret;
while (len) {
loff_t addr = from;
-@@ -2583,6 +2614,7 @@ static int spi_nor_read(struct mtd_info
+@@ -2585,6 +2616,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;
}
-@@ -2600,6 +2632,10 @@ static int sst_write(struct mtd_info *mt
+@@ -2602,6 +2634,10 @@ static int sst_write(struct mtd_info *mt
if (ret)
return ret;
write_enable(nor);
nor->sst_write_second = false;
-@@ -2662,6 +2698,7 @@ static int sst_write(struct mtd_info *mt
+@@ -2664,6 +2700,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;
}
-@@ -2684,6 +2721,10 @@ static int spi_nor_write(struct mtd_info
+@@ -2686,6 +2723,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;
-@@ -2723,6 +2764,7 @@ static int spi_nor_write(struct mtd_info
+@@ -2725,6 +2766,7 @@ static int spi_nor_write(struct mtd_info
}
write_err:
spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE);
return ret;
}
-@@ -4727,9 +4769,13 @@ static int spi_nor_init(struct spi_nor *
+@@ -4729,9 +4771,13 @@ static int spi_nor_init(struct spi_nor *
* reboots (e.g., crashes). Warn the user (or hopefully, system
* designer) that this is bad.
*/