Commit 46b5889
committed
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.com1 parent 98d54f8 commit 46b5889
File tree
5 files changed
+478
-605
lines changed- drivers/mtd
- include/linux/mtd
5 files changed
+478
-605
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
| 352 | + | |
352 | 353 | | |
353 | 354 | | |
354 | 355 | | |
| |||
360 | 361 | | |
361 | 362 | | |
362 | 363 | | |
363 | | - | |
| 364 | + | |
364 | 365 | | |
365 | 366 | | |
366 | 367 | | |
| |||
586 | 587 | | |
587 | 588 | | |
588 | 589 | | |
| 590 | + | |
589 | 591 | | |
590 | 592 | | |
591 | 593 | | |
| |||
597 | 599 | | |
598 | 600 | | |
599 | 601 | | |
600 | | - | |
| 602 | + | |
601 | 603 | | |
602 | | - | |
603 | 604 | | |
604 | 605 | | |
605 | 606 | | |
| |||
635 | 636 | | |
636 | 637 | | |
637 | 638 | | |
| 639 | + | |
638 | 640 | | |
639 | 641 | | |
640 | 642 | | |
| |||
824 | 826 | | |
825 | 827 | | |
826 | 828 | | |
827 | | - | |
| 829 | + | |
828 | 830 | | |
829 | 831 | | |
830 | 832 | | |
| |||
918 | 920 | | |
919 | 921 | | |
920 | 922 | | |
921 | | - | |
| 923 | + | |
922 | 924 | | |
923 | 925 | | |
924 | 926 | | |
| |||
0 commit comments