----- Ursprüngliche Mail ----- > Von: "Miquel Raynal" <miquel.raynal@xxxxxxxxxxx> > An: "richard" <richard@xxxxxx>, "Vignesh Raghavendra" <vigneshr@xxxxxx>, "Tudor Ambarus" <Tudor.Ambarus@xxxxxxxxxxxxx>, > "linux-mtd" <linux-mtd@xxxxxxxxxxxxxxxxxxx> > CC: "Boris Brezillon" <boris.brezillon@xxxxxxxxxxxxx>, "Thomas Petazzoni" <thomas.petazzoni@xxxxxxxxxxx>, "Miquel > Raynal" <miquel.raynal@xxxxxxxxxxx> > Gesendet: Montag, 30. Dezember 2019 12:19:48 > Betreff: [PATCH v2] 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). What problem does this solve? ...beside of a nice diffstat which removes more than it adds. :-) > 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@xxxxxxxxxxx> [...] > +static inline struct mtd_info *mtd_get_master(struct mtd_info *mtd) > +{ > + while (mtd->parent) > + mtd = mtd->parent; > + > + return mtd; > +} So, parent == master? When I create a MTD ontop of UBI using gluebi, who will be parent/master? Thanks, //richard ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/