On 20/10/18 5:55 AM, Tokunori Ikegami wrote: > It is enough to use chip_good() only so chip_ready() is not necessary. > For this change the order to check timeout is also needed to chagne. s/chagne/change/ > > Signed-off-by: Tokunori Ikegami <ikegami@xxxxxxxxxxxxxxxxxxxx> > Cc: Fabio Bettoni <fbettoni@xxxxxxxxx> > Co: Hauke Mehrtens <hauke@xxxxxxxxxx> > Co: Koen Vandeputte <koen.vandeputte@xxxxxxxxxxxx> > Cc: Chris Packham <chris.packham@xxxxxxxxxxxxxxxxxxx> > Cc: Joakim Tjernlund <Joakim.Tjernlund@xxxxxxxxxxxx> > Cc: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxxxxxxx> > Cc: linux-mtd@xxxxxxxxxxxxxxxxxxx > --- > Changes since v1: > - None. > > drivers/mtd/chips/cfi_cmdset_0002.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c > index 251c9e1675bd..c2e51768a02c 100644 > --- a/drivers/mtd/chips/cfi_cmdset_0002.c > +++ b/drivers/mtd/chips/cfi_cmdset_0002.c > @@ -1882,14 +1882,14 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, > continue; > } > > - if (time_after(jiffies, timeo) && !chip_ready(map, adr)) > - break; > - > if (chip_good(map, adr, datum)) { > xip_enable(map, chip, adr); > goto op_done; > } > > + if (time_after(jiffies, timeo)) > + break; > + > /* Latency issues. Drop the lock, wait a while and retry */ > UDELAY(map, chip, adr, 1); > } > ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/