From fa106d76d0fc3d3f16ac62cc028ee5a3521019ce Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 4 Nov 2020 09:39:44 +0100 Subject: mtd: nand: omap_gpmc: Fix wrong length check We may only write more characters when there's actually something left to write. Fix the wrong check. Signed-off-by: Sascha Hauer --- drivers/mtd/nand/nand_omap_gpmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/mtd/nand/nand_omap_gpmc.c') diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c index d10ba5a8a8..670eba4206 100644 --- a/drivers/mtd/nand/nand_omap_gpmc.c +++ b/drivers/mtd/nand/nand_omap_gpmc.c @@ -632,7 +632,7 @@ static void omap_write_buf_pref(struct nand_chip *nand_chip, gpmc_prefetch_enable(info->gpmc_cs, PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x1); - while (len >= 0) { + while (len) { w_count = readl(info->gpmc_base + GPMC_PREFETCH_STATUS); w_count = GPMC_PREFETCH_STATUS_FIFO_CNT(w_count); w_count = w_count >> 2; -- cgit v1.2.3