fix for mtd partitions for erase_size != 2^X
PATCH 1/1 fix for mtd partitions for erase_size != 2^X
Here a trivial patch,
which allows correct creation of mtd partitions, which have erase sizes which are not a power of 2.
Best regards
Peter
mtd/mtdpart.c renamed from mtd/mtdpart.c.orig +3 -3
@@ -465,9 +465,9 @@if (slave->offset ==MTDPART_OFS_APPEND ) slave->offset = cur_offset;if (slave->offset ==MTDPART_OFS_NXTBLK ) { -u_int32_t emask = master->erasesize-1 ; - slave->offset = (cur_offset + emask) & ~emask; -if (slave->offset != cur_offset) { + slave->offset = cur_offset; +if ((cur_offset % master->erasesize) !=0 ) { + slave->offset = ((cur_offset / master->erasesize) +1 ) * master->erasesize;printk (KERN_NOTICE "Moving partition %d: " "0x%08x -> 0x%08x\n" , i, cur_offset, slave->offset);