Skip to contentSkip to conversation

of: Add more stubs for non-OF builds

PATCH In review Alexander Shiyan 2 participants 3 messages Jun 18, 2013 – Jul 20, 2013 1 message not in the archive Device tree

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 of: Add more stubs for non-OF builds

Patch adds of_get_next_child and of_get_next_available_child stubs for non-OF builds.

---
 include/linux/of.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
include/linux/of.h +14 -2
index 1fd08ca..c086c1a 100644
@@ -366,8 +366,17 @@ static inline bool of_have_populated_dt(void)
 	return false;
 }
 
-#define for_each_child_of_node(parent, child) \
-	while (0)
+static inline struct device_node *of_get_next_child(
+	const struct device_node *node, struct device_node *prev)
+{
+	return NULL;
+}
+
+static inline struct device_node *of_get_next_available_child(
+	const struct device_node *node, struct device_node *prev)
+{
+	return NULL;
+}
 
 static inline struct device_node *of_get_child_by_name(
 					const struct device_node *node,
@@ -376,6 +385,9 @@ static inline struct device_node *of_get_child_by_name(
 	return NULL;
 }
 
+#define for_each_child_of_node(parent, child) \
+	while (0)
+
 static inline int of_get_child_count(const struct device_node *np)
 {
 	return 0;
Signature · 1 line
1.8.1.5
#2 lore raw
In reply to a message not in the archive
Quoted 33 lines · Alexander Shiyan

Patch adds of_get_next_child and of_get_next_available_child stubs for non-OF builds.

---
 include/linux/of.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
include/linux/of.h +11 -2
index 1fd08ca..c086c1a 100644
@@ -366,8 +366,17 @@ static inline bool of_have_populated_dt(void)
 	return false;
 }
 
-#define for_each_child_of_node(parent, child) \
-	while (0)
+static inline struct device_node *of_get_next_child(
+	const struct device_node *node, struct device_node *prev)
+{
+	return NULL;
+}
+
+static inline struct device_node *of_get_next_available_child(
+	const struct device_node *node, struct device_node *prev)
+{
+	return NULL;
+}
 
 static inline struct device_node *of_get_child_by_name(
 					const struct device_node *node,

include/linux/of.h static inline struct device_node *of_get_child_by_name( · line 390

Quoted 6 lines
include/linux/of.h +3 -0
@@ -376,6 +385,9 @@ static inline struct device_node *of_get_child_by_name(
 	return NULL;
 }
 
+#define for_each_child_of_node(parent, child) \
+	while (0)
+

Why is the for_each_child_of_node() getting moved?

g.

Quoted 6 lines
include/linux/of.h +0 -0
 static inline int of_get_child_count(const struct device_node *np)
 {
 	return 0;
Signature · 1 line
1.8.1.5
#3 lore raw
Quoted 37 lines · On Sat, 20 Jul 2013 06:31:11 +0100 Grant Likely…
Quoted 36 lines · Alexander Shiyan

Patch adds of_get_next_child and of_get_next_available_child stubs for non-OF builds.

---
 include/linux/of.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
include/linux/of.h +11 -2
index 1fd08ca..c086c1a 100644
@@ -366,8 +366,17 @@ static inline bool of_have_populated_dt(void)
 	return false;
 }
 
-#define for_each_child_of_node(parent, child) \
-	while (0)
+static inline struct device_node *of_get_next_child(
+	const struct device_node *node, struct device_node *prev)
+{
+	return NULL;
+}
+
+static inline struct device_node *of_get_next_available_child(
+	const struct device_node *node, struct device_node *prev)
+{
+	return NULL;
+}
 
 static inline struct device_node *of_get_child_by_name(
 					const struct device_node *node,
@@ -376,6 +385,9 @@ static inline struct device_node *of_get_child_by_name(
 	return NULL;
 }
 
Quoted 5 lines

include/linux/of.h static inline struct device_node *of_get_child_by_name( · line 390

Quoted 3 lines
include/linux/of.h +3 -0
+#define for_each_child_of_node(parent, child) \
+	while (0)
+

Why is the for_each_child_of_node() getting moved?

Please forget this patch, this is no longer needed. A move was to preserve the sort order for "OF" and "non-OF". Thanks.

Signature · 1 line
Alexander Shiyan <shc_work-JGs/[email protected]>