summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-11-04 09:39:44 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-11-09 23:04:01 +0100
commitfa106d76d0fc3d3f16ac62cc028ee5a3521019ce (patch)
treebb6a99edf3504785b6e88ebd7ebc0b61bf77d373
parent7b265343e2f7623de149dafda7203b84cb3e7b1b (diff)
downloadbarebox-fa106d76d0fc3d3f16ac62cc028ee5a3521019ce.tar.gz
barebox-fa106d76d0fc3d3f16ac62cc028ee5a3521019ce.tar.xz
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 <s.hauer@pengutronix.de>
-rw-r--r--drivers/mtd/nand/nand_omap_gpmc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c
index d10ba5a8a..670eba420 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;