diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2013-11-07 00:26:18 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2013-11-07 20:02:22 +0100 |
commit | 40cca26f38f5c48c2aa833fb504f5c523089ac16 (patch) | |
tree | 3a6a5fe74a37a8882fbb1828b7247fe44031c777 | |
parent | 2cdcb05222926e10806a44d2ab923c4a2090f979 (diff) |
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 <hauke@hauke-m.de>
-rw-r--r-- | backport/backport-include/linux/of.h | 23 | ||||
-rw-r--r-- | backport/compat/compat-3.7.c | 2 |
2 files changed, 8 insertions, 17 deletions
diff --git a/backport/backport-include/linux/of.h b/backport/backport-include/linux/of.h index ad852c10..8b243115 100644 --- a/backport/backport-include/linux/of.h +++ b/backport/backport-include/linux/of.h @@ -3,18 +3,13 @@ #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); @@ -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 675cf293..b21b8acf 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 */ |