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.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -83,6 +83,9 @@ struct fwnode_handle *fwnode_find_reference(const struct fwnode_handle *fwnode, · 82 unmodified lines | |||
| 83 | struct fwnode_handle *fwnode_get_parent(const struct fwnode_handle *fwnode); | 83 | struct fwnode_handle *fwnode_get_parent(const struct fwnode_handle *fwnode); |
| 84 | struct fwnode_handle *fwnode_get_next_parent( | 84 | struct fwnode_handle *fwnode_get_next_parent( |
| 85 | struct fwnode_handle *fwnode); | 85 | struct fwnode_handle *fwnode); |
| 86 | unsigned int fwnode_count_parents(const struct fwnode_handle *fwn); | ||
| 87 | struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwn, | ||
| 88 | unsigned int depth); | ||
| 86 | struct fwnode_handle *fwnode_get_next_child_node( | 89 | struct fwnode_handle *fwnode_get_next_child_node( |
| 87 | const struct fwnode_handle *fwnode, struct fwnode_handle *child); | 90 | const struct fwnode_handle *fwnode, struct fwnode_handle *child); |
| 88 | struct fwnode_handle *fwnode_get_next_available_child_node( | 91 | struct fwnode_handle *fwnode_get_next_available_child_node( |