diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2015-11-22 19:18:14 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2015-11-24 00:06:43 +0100 |
commit | 8485761da3ea9a8a9fb56252c0a86dcae23d93ea (patch) | |
tree | 7bf99ee47be9537d0889dbd042683b56cffd052b | |
parent | b9100facd22ffbc3ae25eb4ba11058889fb9dcdd (diff) |
header: add of_node_full_name()
This function was added in commit 74a7f0844 "devicetree: add helper
inline for retrieving a node's full name".
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r-- | backport/backport-include/linux/of.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/backport/backport-include/linux/of.h b/backport/backport-include/linux/of.h index ab98061e..8089803f 100644 --- a/backport/backport-include/linux/of.h +++ b/backport/backport-include/linux/of.h @@ -184,4 +184,19 @@ static inline int of_property_read_u64_array(const struct device_node *np, #endif /* CONFIG_OF */ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0) +#define of_node_full_name LINUX_BACKPORT(of_node_full_name) +#ifdef CONFIG_OF +static inline const char *of_node_full_name(const struct device_node *np) +{ + return np ? np->full_name : "<no-node>"; +} +#else +static inline const char* of_node_full_name(const struct device_node *np) +{ + return "<no-node>"; +} +#endif /* CONFIG_OF */ +#endif /* < 3.6 */ + #endif /* _COMPAT_LINUX_OF_H */ |