diff options
author | Arend Van Spriel <arend.vanspriel@broadcom.com> | 2017-02-02 18:38:17 +0000 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-02-07 07:33:08 +0100 |
commit | 4838bb4037d347889c6de55dd03038218ec435f7 (patch) | |
tree | 4daa6a6614ac47f8781f77c2f4a1b690a2a8bc02 /backport/backport-include/linux | |
parent | 1bbac4f20a4c6a1095b3d820fca07f10c7110fd4 (diff) |
backports: add definition for dev_of_node()
Since 4.10-rc1 there is use of dev_of_node() added to cfg80211, which
was introduced in 4.1 kernel. So backport the function for older kernels.
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'backport/backport-include/linux')
-rw-r--r-- | backport/backport-include/linux/device.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h index cc847383..592d7b10 100644 --- a/backport/backport-include/linux/device.h +++ b/backport/backport-include/linux/device.h @@ -261,4 +261,16 @@ extern char *devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...); #endif /* < 3.17 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0) +#define dev_of_node LINUX_BACKPORT(dev_of_node) +static inline struct device_node *dev_of_node(struct device *dev) +{ +#ifndef CONFIG_OF + return NULL; +#else + return dev->of_node; +#endif +} +#endif + #endif /* __BACKPORT_DEVICE_H */ |