Skip to content
Commit 21cc1fb5 authored by Miquel Raynal's avatar Miquel Raynal Committed by Jagan Teki
Browse files

mtd: mtdpart: add a generic mtdparts-like parser



The current parser is very specific to U-Boot mtdparts implementation.
It does not use MTD structures like mtd_info and mtd_partition. Copy
and adapt the current parser in drivers/mtd/mtd-uclass.c (to not break
the current use of mtdparts.c itself) and write some kind of a wrapper
around the current implementation to allow other commands to benefit
from this parsing in a user-friendly way.

This new function will allocate an mtd_partition array for each
successful call. This array must be freed after use by the caller.
The given 'mtdparts' buffer pointer will be moved forward to the next
MTD device (if any, it will point towards a '\0' character otherwise).

Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Acked-by: default avatarJagan Teki <jagan@openedev.com>
Reviewed-by: default avatarStefan Roese <sr@denx.de>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
parent e9f62db6
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment