+++ /dev/null
---- a/drivers/mtd/chips/cfi_cmdset_0002.c
-+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
-@@ -1707,7 +1707,8 @@ static int __xipram do_write_oneword_onc
- if (chip_good(map, chip, adr, datum)) {
- if (cfi_check_err_status(map, chip, adr))
- ret = -EIO;
-- break;
-+ xip_enable(map, chip, adr);
-+ return ret;
- }
-
- /* Latency issues. Drop the lock, wait a while and retry */
-@@ -1789,6 +1790,7 @@ static int __xipram do_write_oneword_ret
- goto retry;
- }
- }
-+
- xip_enable(map, chip, adr);
-
- return ret;
-@@ -2409,7 +2411,6 @@ static int cfi_amdstd_panic_write(struct
- return 0;
- }
-
--
- /*
- * Handle devices with one erase region, that only implement
- * the chip erase command.
-@@ -2479,7 +2480,7 @@ static int __xipram do_erase_chip(struct
- if (chip_good(map, chip, adr, map_word_ff(map))) {
- if (cfi_check_err_status(map, chip, adr))
- ret = -EIO;
-- break;
-+ goto op_done;
- }
-
- if (time_after(jiffies, timeo)) {
-@@ -2504,6 +2505,7 @@ static int __xipram do_erase_chip(struct
- }
- }
-
-+ op_done:
- chip->state = FL_READY;
- xip_enable(map, chip, adr);
- DISABLE_VPP(map);
-@@ -2578,7 +2580,7 @@ static int __xipram do_erase_oneblock(st
- if (chip_good(map, chip, adr, map_word_ff(map))) {
- if (cfi_check_err_status(map, chip, adr))
- ret = -EIO;
-- break;
-+ goto op_done;
- }
-
- if (time_after(jiffies, timeo)) {
-@@ -2603,6 +2605,7 @@ static int __xipram do_erase_oneblock(st
- }
- }
-
-+ op_done:
- chip->state = FL_READY;
- xip_enable(map, chip, adr);
- DISABLE_VPP(map);