From 15a0701cdde8eeae2a54880b813cdb8cdc09a384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 6 Feb 2020 13:57:11 +0100 Subject: kernel: rewrite run_parsers_by_type() to use add_mtd_partitions() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make run_parsers_by_type() more similar to the parse_mtd_partitions(): 1. Use struct mtd_partitions 2. Use add_mtd_partitions() This change simplifies run_parsers_by_type() by: 1. Dropping loop 2. Dropping code getting partition properties (name, offset, size) Moreover this change allows passing more partitions details (e.g. mask_flags). One noticeable change introduced by this patch is adding parsed partitions as children. This results in printing their *relative* offsets which unifies this code with parse_mtd_partitions() behaviour. Before: [ 1.785448] 0x00000018f800-0x000000fb0000 : "rootfs" [ 1.791642] mtd: device 4 (rootfs) set to be root filesystem [ 1.797537] 1 squashfs-split partitions found on MTD device rootfs [ 1.804009] 0x0000004e0000-0x000000fb0000 : "rootfs_data" After: [ 1.785376] 0x00000018f800-0x000000fb0000 : "rootfs" [ 1.791601] mtd: device 4 (rootfs) set to be root filesystem [ 1.797491] 1 squashfs-split partitions found on MTD device rootfs [ 1.803936] Creating 1 MTD partitions on "rootfs": [ 1.808910] 0x000000350800-0x000000e20800 : "rootfs_data" Signed-off-by: Rafał Miłecki --- .../linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch') diff --git a/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch b/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch index 7b481ffb47..d1a32872af 100644 --- a/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch +++ b/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch @@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -1260,6 +1260,24 @@ int mtd_is_partition(const struct mtd_in +@@ -1251,6 +1251,24 @@ int mtd_is_partition(const struct mtd_in } EXPORT_SYMBOL_GPL(mtd_is_partition); -- cgit v1.2.3