[PATCH 03/62] mtd: provide of_mtd_parse_partitions for !CONFIG_MTD_OF_PARTS

Jamie Iles jamie at jamieiles.com
Mon May 23 05:22:44 EDT 2011


If we don't have OpenFirmware enabled then provide a stub
of_mtd_parse_partitions that returns no partitions so drivers don't need
ifdeffery inside.

Cc: David Woodhouse <dwmw2 at infradead.org>
Cc: Artem Bityutskiy <dedekind1 at gmail.com>
Signed-off-by: Jamie Iles <jamie at jamieiles.com>
---
 include/linux/mtd/partitions.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index 998a6cf..afe32db 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -73,9 +73,18 @@ extern int parse_mtd_partitions(struct mtd_info *master, const char **types,
 struct device;
 struct device_node;
 
+#ifdef CONFIG_MTD_OF_PARTS
 int __devinit of_mtd_parse_partitions(struct device *dev,
                                       struct device_node *node,
                                       struct mtd_partition **pparts);
+#else
+static inline int of_mtd_parse_partitions(struct device *dev,
+					  struct device_node *node,
+					  struct mtd_partition **pparts)
+{
+	return 0;
+}
+#endif
 
 #ifdef CONFIG_MTD_PARTITIONS
 static inline int mtd_has_partitions(void) { return 1; }
-- 
1.7.4.4




More information about the linux-mtd mailing list