From: Hauke Mehrtens Date: Wed, 6 Nov 2013 23:26:18 +0000 (+0100) Subject: backports: always activate the of.h backports X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=40cca26f38f5c48c2aa833fb504f5c523089ac16;p=openwrt%2Fstaging%2Fblogic.git backports: always activate the of.h backports This removes the KERNEL_HAS_OF_SUPPORT option from backports. We can not include linux/of.h on kernel < 2.6.34, because this depends on some sparc and powerpc only headers. The backport code should still be included in this header file for such kernel versions, because some recent drivers are using these functions now on all platforms, but they will use the empty implementations then. Signed-off-by: Hauke Mehrtens --- diff --git a/backport/backport-include/linux/of.h b/backport/backport-include/linux/of.h index ad852c10f91e..8b2431157be3 100644 --- a/backport/backport-include/linux/of.h +++ b/backport/backport-include/linux/of.h @@ -3,18 +3,13 @@ #include -#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 +#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); @@ -26,9 +21,9 @@ static inline struct device_node *of_get_child_by_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) @@ -36,8 +31,6 @@ static inline struct device_node *of_find_node_by_name(struct device_node *from, 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 */ diff --git a/backport/compat/compat-3.7.c b/backport/compat/compat-3.7.c index 675cf293d17a..b21b8acfa427 100644 --- a/backport/compat/compat-3.7.c +++ b/backport/compat/compat-3.7.c @@ -254,7 +254,6 @@ int pcie_capability_clear_and_set_dword(struct pci_dev *dev, int pos, 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)) /** @@ -281,4 +280,3 @@ struct device_node *of_get_child_by_name(const struct device_node *node, 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 */