Skip to contentSkip to conversation

of: add stub of_get_child_by_name for non-OF builds

PATCH New Olof Johansson 2 participants 2 messages Oct 7, 2012 – Oct 8, 2012 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of: add stub of_get_child_by_name for non-OF builds

Fixes build error on s3c6400_defconfig, introduced by commit 06455bbcab76e5f5225de5f38ab948d37a1c3587, "dt/s3c64xx/spi: Use of_get_child_by_name to get a named child".

drivers/spi/spi-s3c64xx.c: In function 's3c64xx_get_slave_ctrldata':
drivers/spi/spi-s3c64xx.c:838:2: error: implicit declaration of function
'of_get_child_by_name' [-Werror=implicit-function-declaration]

---
 include/linux/of.h | 7 +++++++
 1 file changed, 7 insertions(+)
include/linux/of.h +7 -0
index 72843b7..b4e50d5 100644
@@ -331,6 +331,13 @@ static inline bool of_have_populated_dt(void)
 #define for_each_child_of_node(parent, child) \
 	while (0)
 
+static inline struct device_node *of_get_child_by_name(
+					const struct device_node *node,
+					const char *name)
+{
+	return NULL;
+}
+
 static inline int of_get_child_count(const struct device_node *np)
 {
 	return 0;
Signature · 1 line
1.7.10.1.488.g05fbf7a
Applied
#1 lore raw

PATCH 1/1 of: add stub of_get_child_by_name for non-OF builds

Quoted 10 lines · Olof Johansson

Fixes build error on s3c6400_defconfig, introduced by commit 06455bbcab76e5f5225de5f38ab948d37a1c3587, "dt/s3c64xx/spi: Use of_get_child_by_name to get a named child".

drivers/spi/spi-s3c64xx.c: In function 's3c64xx_get_slave_ctrldata':
drivers/spi/spi-s3c64xx.c:838:2: error: implicit declaration of function
'of_get_child_by_name' [-Werror=implicit-function-declaration]

---

Applied, thanks.

Rob

Quoted 22 lines
 include/linux/of.h | 7 +++++++
 1 file changed, 7 insertions(+)
include/linux/of.h +7 -0
index 72843b7..b4e50d5 100644
@@ -331,6 +331,13 @@ static inline bool of_have_populated_dt(void)
 #define for_each_child_of_node(parent, child) \
 	while (0)
 
+static inline struct device_node *of_get_child_by_name(
+					const struct device_node *node,
+					const char *name)
+{
+	return NULL;
+}
+
 static inline int of_get_child_count(const struct device_node *np)
 {
 	return 0;