UBI: Set free_count to zero before walking through erase list
authorHeiko Schocher <hs@denx.de>
Fri, 22 Apr 2016 10:06:38 +0000 (12:06 +0200)
committerRichard Weinberger <richard@nod.at>
Tue, 24 May 2016 13:24:33 +0000 (15:24 +0200)
commit73b0cd57fcd07201b138214f9a2353f76dd9ae2c
tree3daf450d9453a750700cedf5e58c05cb4edcb178
parent24663e7281b8fbfaae22467ec2625e2bffe07815
UBI: Set free_count to zero before walking through erase list

Set free_count to zero before walking through ai->erase list
in wl_init().

Found in U-Boot as U-Boot has no workqueue/threads, it immediately
calls erase_worker(), which increase for each erased block
free_count. Without this patch, free_count gets after
this initialized to zero in wl_init(), so the free_count
variable always has the maybe wrong value 0 in U-Boot.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/ubi/wl.c