mtd: provide of_mtd_parse_partitions for !CONFIG_MTD_OF_PARTS
authorJamie Iles <jamie@jamieiles.com>
Mon, 23 May 2011 09:22:44 +0000 (10:22 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 25 May 2011 01:12:51 +0000 (02:12 +0100)
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.

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
include/linux/mtd/partitions.h

index 998a6cf3516761e71657aad2205797d89b26755b..afe32db14a872e35e4fc7d238ede283fdecae797 100644 (file)
@@ -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; }