1 --- a/drivers/mtd/chips/cfi_cmdset_0002.c
2 +++ b/drivers/mtd/chips/cfi_cmdset_0002.c
3 @@ -1218,8 +1218,8 @@ static int __xipram do_write_oneword(str
7 - if (chip_ready(map, adr))
9 + if (chip_good(map, adr, datum))
12 /* Latency issues. Drop the lock, wait a while and retry */
13 UDELAY(map, chip, adr, 1);
14 @@ -1235,6 +1235,8 @@ static int __xipram do_write_oneword(str
20 xip_enable(map, chip, adr);
22 chip->state = FL_READY;
23 @@ -1581,7 +1583,6 @@ static int cfi_amdstd_write_buffers(stru
29 * Handle devices with one erase region, that only implement
30 * the chip erase command.
31 @@ -1645,8 +1646,8 @@ static int __xipram do_erase_chip(struct
32 chip->erase_suspended = 0;
35 - if (chip_ready(map, adr))
37 + if (chip_good(map, adr, map_word_ff(map)))
40 if (time_after(jiffies, timeo)) {
41 printk(KERN_WARNING "MTD %s(): software timeout\n",
42 @@ -1666,6 +1667,7 @@ static int __xipram do_erase_chip(struct
47 chip->state = FL_READY;
48 xip_enable(map, chip, adr);
49 put_chip(map, chip, adr);
50 @@ -1733,9 +1735,9 @@ static int __xipram do_erase_oneblock(st
51 chip->erase_suspended = 0;
54 - if (chip_ready(map, adr)) {
55 + if (chip_good(map, adr, map_word_ff(map))) {
56 xip_enable(map, chip, adr);
61 if (time_after(jiffies, timeo)) {
62 @@ -1757,6 +1759,7 @@ static int __xipram do_erase_oneblock(st
67 chip->state = FL_READY;
68 put_chip(map, chip, adr);
69 mutex_unlock(&chip->mutex);