summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2019-10-03 15:32:11 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-10-11 11:26:55 +0200
commit87e5e95db31a27d117fbb4a5d464f44adb4c2ee2 (patch)
tree8169cd9ea74f307d7b31d10fddefccafed9ce813 /include/linux
parenta57b7fb783eb352d91b0bf8391682b30bacae667 (diff)
device property: Add functions for accessing node's parents
Add two convenience functions for accessing node's parents: fwnode_count_parents() returns the number of parent nodes a given node has. fwnode_get_nth_parent() returns node's parent at a given distance from the node itself. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/property.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/property.h b/include/linux/property.h
index 87d795a1e2d6..ea27c5811e1b 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -83,6 +83,9 @@ struct fwnode_handle *fwnode_find_reference(const struct fwnode_handle *fwnode,
struct fwnode_handle *fwnode_get_parent(const struct fwnode_handle *fwnode);
struct fwnode_handle *fwnode_get_next_parent(
struct fwnode_handle *fwnode);
+unsigned int fwnode_count_parents(const struct fwnode_handle *fwn);
+struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwn,
+ unsigned int depth);
struct fwnode_handle *fwnode_get_next_child_node(
const struct fwnode_handle *fwnode, struct fwnode_handle *child);
struct fwnode_handle *fwnode_get_next_available_child_node(