aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-4.14/041-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2018-01-11 11:59:39 +0100
committerRafał Miłecki <rafal@milecki.pl>2018-01-11 12:07:49 +0100
commitbde5e7a632ef06b16ea77af037c1442e10949666 (patch)
tree51dce463c6c4514b9da7ea389cab4133072c3129 /target/linux/generic/backport-4.14/041-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch
parentef27f153302b9f8296f5a8c71d08ae7392e721de (diff)
downloadupstream-bde5e7a632ef06b16ea77af037c1442e10949666.tar.gz
upstream-bde5e7a632ef06b16ea77af037c1442e10949666.tar.bz2
upstream-bde5e7a632ef06b16ea77af037c1442e10949666.zip
kernel: backport mtd implementation for "compatible" in "partitions" subnode
This backports upstream support for "compatible" DT property set for the "partitions" subnode of flash node. It allows specifying how partitions should be created/parsed. Right now only "fixed-partitions" is supported. It should eventually replace our downstream "linux,part-probe" solution. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/generic/backport-4.14/041-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch')
-rw-r--r--target/linux/generic/backport-4.14/041-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/target/linux/generic/backport-4.14/041-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch b/target/linux/generic/backport-4.14/041-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch
new file mode 100644
index 0000000000..2092cc28fd
--- /dev/null
+++ b/target/linux/generic/backport-4.14/041-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch
@@ -0,0 +1,43 @@
+From 4ac9222778478a00c7fc9d347b7ed1e0e595120d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Thu, 4 Jan 2018 08:05:34 +0100
+Subject: [PATCH] mtd: ofpart: add of_match_table with "fixed-partitions"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This allows using this parser with any flash driver that takes care of
+setting of_node (using mtd_set_of_node helper) correctly. Up to now
+support for "fixed-partitions" DT compatibility string was working only
+with flash drivers that were specifying "ofpart" (manually or by letting
+mtd use the default set of parsers).
+
+This matches existing bindings documentation.
+
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+Reviewed-by: Brian Norris <computersforpeace@gmail.com>
+Tested-by: Brian Norris <computersforpeace@gmail.com>
+Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
+---
+ drivers/mtd/ofpart.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/drivers/mtd/ofpart.c
++++ b/drivers/mtd/ofpart.c
+@@ -140,9 +140,16 @@ ofpart_none:
+ return ret;
+ }
+
++static const struct of_device_id parse_ofpart_match_table[] = {
++ { .compatible = "fixed-partitions" },
++ {},
++};
++MODULE_DEVICE_TABLE(of, parse_ofpart_match_table);
++
+ static struct mtd_part_parser ofpart_parser = {
+ .parse_fn = parse_ofpart_partitions,
+ .name = "ofpart",
++ .of_match_table = parse_ofpart_match_table,
+ };
+
+ static int parse_ofoldpart_partitions(struct mtd_info *master,