diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-01-14 12:09:52 +0300 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-03-11 16:49:30 +0300 |
commit | 46b5889cc2c54bac7d7e727a44d28a298df23cef (patch) | |
tree | f3baa809955aa2f4769e3f95e51be986db9a34ee /include/linux/mtd/partitions.h | |
parent | 98d54f81e36ba3bf92172791eba5ca5bd813989b (diff) | |
download | linux-46b5889cc2c54bac7d7e727a44d28a298df23cef.tar.xz |
mtd: 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.
While at it, be consistent in the naming of the mtd_info structures to
ease the understanding of the new hierarchy: these structures are
usually called 'mtd', unless there are multiple instances of the same
structure. In this case, there is usually a parent/child bound so we
will call them 'parent' and 'child'.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200114090952.11232-1-miquel.raynal@bootlin.com
Diffstat (limited to 'include/linux/mtd/partitions.h')
-rw-r--r-- | include/linux/mtd/partitions.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 11cb0c50cd84..e545c050d3e8 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h @@ -105,7 +105,6 @@ extern void deregister_mtd_parser(struct mtd_part_parser *parser); module_driver(__mtd_part_parser, register_mtd_parser, \ deregister_mtd_parser) -int mtd_is_partition(const struct mtd_info *mtd); int mtd_add_partition(struct mtd_info *master, const char *name, long long offset, long long length); int mtd_del_partition(struct mtd_info *master, int partno); |