summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMarek BehĂșn <[email protected]>2021-05-26 14:08:19 +0200
committerJagan Teki <[email protected]>2021-06-24 11:53:15 +0530
commitdc339bf784f08707583a5b6465381354f48d4fa8 (patch)
tree219b53b6ce55e9b7cf7f652be1390dbc0426166d /include/linux
parent0e116bea52af1b665a656d49c328468e976be913 (diff)
mtd: add support for parsing partitions defined in OF
Add support for parsing partitions defined in device-trees via the `partitions` node with `fixed-partitions` compatible. The `mtdparts`/`mtdids` mechanism takes precedence. If some partitions are defined for a MTD device via this mechanism, the code won't register partitions for that MTD device from OF, even if they are defined. Signed-off-by: Marek BehĂșn <[email protected]> Reviewed-by: Miquel Raynal <[email protected]> Tested-by: Patrice Chotard <[email protected]> Reviewed-by: Jagan Teki <[email protected]> Cc: Simon Glass <[email protected]> Cc: Heiko Schocher <[email protected]> Cc: Patrick Delaunay <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/mtd.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 927854950a0..3b302fb8c31 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -581,6 +581,16 @@ static inline int del_mtd_partitions(struct mtd_info *mtd)
}
#endif
+#if defined(CONFIG_MTD_PARTITIONS) && CONFIG_IS_ENABLED(DM) && \
+ CONFIG_IS_ENABLED(OF_CONTROL)
+int add_mtd_partitions_of(struct mtd_info *master);
+#else
+static inline int add_mtd_partitions_of(struct mtd_info *master)
+{
+ return 0;
+}
+#endif
+
struct mtd_info *__mtd_next_device(int i);
#define mtd_for_each_device(mtd) \
for ((mtd) = __mtd_next_device(0); \