mtd: partition: Fix multi eraseregion chips
The current code counts the eraseregions a new partition spans and
sets the partitions number of eraseregions accordingly, but the code
forgets to allocate and fill in the eraseregions for the partition
mtd device. This makes the erase operation crash with a NULL pointer
exception.
This patch fixes this with the same approach the kernel uses: Set
the number of eraseregions to 1 unconditionally and the eraseregion
size to the maximum of the eraseregions found in the partition.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 436ea81 commit 02fed023e12bcb2ad273dba54cd1a6c163aada1d
@Sascha Hauer Sascha Hauer authored on 10 Jun 2014
Showing 1 changed file
View
drivers/mtd/partition.c