mtd: parsers: ofpart: allow 0xff size cells to denote 'rest-of-flash'
PATCH 1/1 mtd: parsers: ofpart: allow 0xff size cells to denote 'rest-of-flash'
In cmdlinepart it's possible to use '-' as partition size to denote rest of available flash size. This patch brings this functionality to ofpart. If all size cells are set to all 0xff's ofpart will use rest of available flash size.
Signed-off-by Alexander Vickberg <[email protected]>
--- drivers/mtd/parsers/ofpart_core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mtd/parsers/ofpart_core.c +3 -0
@@ -133,6 +133,9 @@ static int parse_fixed_partitions(struct mtd_info *master, parts[i].size =of_read_number (reg + a_cells, s_cells); parts[i].of_node = pp; +if (!memchr_inv (reg + a_cells,0xff , s_cells<<2 )) + parts[i].size = master->size - parts[i].offset; + partname =of_get_property (pp,"label" , &len);if (!partname) partname =of_get_property (pp,"name" , &len);
Signature · 6 lines
2.34.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/