diff options
author | Rob Herring <robh@kernel.org> | 2018-08-27 07:50:47 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2018-08-30 13:53:05 -0500 |
commit | f42b0e18f2e5cf34f73ef1b6327b49040b307a33 (patch) | |
tree | 483166e1216f21bc0ebabe76553a2c7940b0e9ca /include | |
parent | 36156f9241cb0f9e37d998052873ca7501ad4b36 (diff) |
of: add node name compare helper functions
In preparation to remove device_node.name pointer, add helper functions
for node name comparisons which are a common pattern throughout the kernel.
Cc: Frank Rowand <frowand.list@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/of.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index b99a1a8c2952..688c52dd7b3e 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -256,6 +256,9 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size) #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) +extern bool of_node_name_eq(const struct device_node *np, const char *name); +extern bool of_node_name_prefix(const struct device_node *np, const char *prefix); + static inline const char *of_node_full_name(const struct device_node *np) { return np ? np->full_name : "<no-node>"; @@ -563,6 +566,16 @@ static inline struct device_node *to_of_node(const struct fwnode_handle *fwnode) return NULL; } +static inline bool of_node_name_eq(const struct device_node *np, const char *name) +{ + return false; +} + +static inline bool of_node_name_prefix(const struct device_node *np, const char *prefix) +{ + return false; +} + static inline const char* of_node_full_name(const struct device_node *np) { return "<no-node>"; |