diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2018-09-29 12:58:27 +0200 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2018-10-02 22:12:32 +0530 |
commit | 2a74930da57f6fbe3c24509f1d481f435acd2356 (patch) | |
tree | 63905613152ac9d2850b75084c7aa3213d4d6825 /drivers/mtd/mtdcore.c | |
parent | ff4afa8a981e22eef670c7c857cb87983346cc2c (diff) | |
download | u-boot-2a74930da57f6fbe3c24509f1d481f435acd2356.zip u-boot-2a74930da57f6fbe3c24509f1d481f435acd2356.tar.gz u-boot-2a74930da57f6fbe3c24509f1d481f435acd2356.tar.bz2 |
mtd: mtdpart: implement proper partition handling
Instead of collecting partitions in a flat list, create a hierarchy
within the mtd_info structure: use a partitions list to keep track of
the partitions of an MTD device (which might be itself a partition of
another MTD device), a pointer to the parent device (NULL when the MTD
device is the root one, not a partition).
By also saving directly in mtd_info the offset of the partition, we
can get rid of the mtd_part structure.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
Diffstat (limited to 'drivers/mtd/mtdcore.c')
-rw-r--r-- | drivers/mtd/mtdcore.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index fb1d68d..fb6c779 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -426,6 +426,8 @@ int add_mtd_device(struct mtd_info *mtd) mtd->index = i; mtd->usecount = 0; + INIT_LIST_HEAD(&mtd->partitions); + /* default value if not set by driver */ if (mtd->bitflip_threshold == 0) mtd->bitflip_threshold = mtd->ecc_strength; |