of: add stub of_get_child_by_name for non-OF builds
authorOlof Johansson <olof@lixom.net>
Sun, 7 Oct 2012 17:40:54 +0000 (10:40 -0700)
committerRob Herring <rob.herring@calxeda.com>
Wed, 17 Oct 2012 20:53:00 +0000 (15:53 -0500)
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]

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
include/linux/of.h

index 72843b72a2b2619a5343be071d1ad104a9cb75af..b4e50d56fc7440b1b1d03849e33b77acf7ee41b6 100644 (file)
@@ -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;