#include <linux/version.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
-#define KERNEL_HAS_OF_SUPPORT 1
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */
-
-#ifdef CONFIG_OF
-#define KERNEL_HAS_OF_SUPPORT 1
-#endif /* CONFIG_OF */
-
-#ifdef KERNEL_HAS_OF_SUPPORT
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34) || defined(CONFIG_OF)
#include_next <linux/of.h>
+#else
+struct device_node;
+#endif
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
#ifdef CONFIG_OF
extern struct device_node *of_get_child_by_name(const struct device_node *node,
const char *name);
return NULL;
}
#endif /* CONFIG_OF */
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) */
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
#ifndef CONFIG_OF
static inline struct device_node *of_find_node_by_name(struct device_node *from,
const char *name)
return NULL;
}
#endif /* CONFIG_OF */
-#endif
-
-#endif /* KERNEL_HAS_OF_SUPPORT */
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
#endif /* _COMPAT_LINUX_OF_H */
EXPORT_SYMBOL_GPL(pcie_capability_clear_and_set_dword);
#endif
-#ifdef KERNEL_HAS_OF_SUPPORT
#ifdef CONFIG_OF
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
/**
EXPORT_SYMBOL_GPL(of_get_child_by_name);
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) */
#endif /* CONFIG_OF */
-#endif /* KERNEL_HAS_OF_SUPPORT */