From 5e8b4be531778aa8b6783fa431e6dd3f2865c926 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 30 Jul 2018 08:38:30 +0200 Subject: [PATCH] kernel: add DT binding support to the mtd redboot parser MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It allows using that parser with the "compatible" set in DT. Signed-off-by: Rafał Miłecki --- ...t-add-of_match_table-with-DT-binding.patch | 31 +++++++++++++++++++ ...t-add-of_match_table-with-DT-binding.patch | 31 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 target/linux/generic/pending-4.14/419-mtd-redboot-add-of_match_table-with-DT-binding.patch create mode 100644 target/linux/generic/pending-4.9/419-mtd-redboot-add-of_match_table-with-DT-binding.patch diff --git a/target/linux/generic/pending-4.14/419-mtd-redboot-add-of_match_table-with-DT-binding.patch b/target/linux/generic/pending-4.14/419-mtd-redboot-add-of_match_table-with-DT-binding.patch new file mode 100644 index 0000000000..b47a621055 --- /dev/null +++ b/target/linux/generic/pending-4.14/419-mtd-redboot-add-of_match_table-with-DT-binding.patch @@ -0,0 +1,31 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: [PATCH] mtd: redboot: add of_match_table with DT binding +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This allows parsing RedBoot compatible partitions for properly described +flash device in DT. + +Signed-off-by: Rafał Miłecki +--- + +--- a/drivers/mtd/redboot.c ++++ b/drivers/mtd/redboot.c +@@ -289,9 +289,16 @@ static int parse_redboot_partitions(stru + return ret; + } + ++static const struct of_device_id redboot_parser_of_match_table[] = { ++ { .compatible = "redhat,redboot-partitions" }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, redboot_parser_of_match_table); ++ + static struct mtd_part_parser redboot_parser = { + .parse_fn = parse_redboot_partitions, + .name = "RedBoot", ++ .of_match_table = redboot_parser_of_match_table, + }; + module_mtd_part_parser(redboot_parser); + diff --git a/target/linux/generic/pending-4.9/419-mtd-redboot-add-of_match_table-with-DT-binding.patch b/target/linux/generic/pending-4.9/419-mtd-redboot-add-of_match_table-with-DT-binding.patch new file mode 100644 index 0000000000..b47a621055 --- /dev/null +++ b/target/linux/generic/pending-4.9/419-mtd-redboot-add-of_match_table-with-DT-binding.patch @@ -0,0 +1,31 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: [PATCH] mtd: redboot: add of_match_table with DT binding +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This allows parsing RedBoot compatible partitions for properly described +flash device in DT. + +Signed-off-by: Rafał Miłecki +--- + +--- a/drivers/mtd/redboot.c ++++ b/drivers/mtd/redboot.c +@@ -289,9 +289,16 @@ static int parse_redboot_partitions(stru + return ret; + } + ++static const struct of_device_id redboot_parser_of_match_table[] = { ++ { .compatible = "redhat,redboot-partitions" }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, redboot_parser_of_match_table); ++ + static struct mtd_part_parser redboot_parser = { + .parse_fn = parse_redboot_partitions, + .name = "RedBoot", ++ .of_match_table = redboot_parser_of_match_table, + }; + module_mtd_part_parser(redboot_parser); + -- 2.25.1