Skip to contentSkip to conversation

dt: add empty for_each_child_of_node, of_find_property

PATCH Applied Stephen Warren 2 participants 2 messages Sep 21, 2011 – Sep 22, 2011 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt: add empty for_each_child_of_node, of_find_property

The patch adds a couple empty functions for non-dt build, so that drivers migrating to dt can save some '#ifdef CONFIG_OF'.

---
Unfortunately, I screwed up and my recent sdhci-tegra.c changes rely on this change to compile without CONFIG_OF; I really need to stop doing my test- builds in a single branch will all my outstanding changes present:-(

 include/linux/of.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
include/linux/of.h +10 -0
index 9180dc5..1fc5875 100644
@@ -242,6 +242,16 @@ static inline bool of_have_populated_dt(void)
 	return false;
 }
 
+#define for_each_child_of_node(parent, child) \
+	while (0)
+
+static inline struct property *of_find_property(const struct device_node *np,
+						const char *name,
+						int *lenp)
+{
+	return NULL;
+}
+
 static inline int of_property_read_u32_array(const struct device_node *np,
 					     const char *propname,
 					     u32 *out_values, size_t sz)
Signature · 1 line
1.7.0.4
Applied
#1 lore raw
Quoted 5 lines · Stephen Warren

The patch adds a couple empty functions for non-dt build, so that drivers migrating to dt can save some '#ifdef CONFIG_OF'.

---

Applied, thanks.

g.

Quoted 31 lines

Unfortunately, I screwed up and my recent sdhci-tegra.c changes rely on this change to compile without CONFIG_OF; I really need to stop doing my test- builds in a single branch will all my outstanding changes present:-(

 include/linux/of.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
include/linux/of.h +10 -0
index 9180dc5..1fc5875 100644
@@ -242,6 +242,16 @@ static inline bool of_have_populated_dt(void)
 	return false;
 }
 
+#define for_each_child_of_node(parent, child) \
+	while (0)
+
+static inline struct property *of_find_property(const struct device_node *np,
+						const char *name,
+						int *lenp)
+{
+	return NULL;
+}
+
 static inline int of_property_read_u32_array(const struct device_node *np,
 					     const char *propname,
 					     u32 *out_values, size_t sz)
Signature · 1 line
1.7.0.4