We may only write more characters when there's actually something left
to write. Fix the wrong check.

Signed-off-by: Sascha Hauer <[email protected]>
---
 drivers/mtd/nand/nand_omap_gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.20.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to