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 | 83 | struct fwnode_handle *fwnode_get_parent(const struct fwnode_handle *fwnode); |
| 84 | 84 | struct fwnode_handle *fwnode_get_next_parent( |
| 85 | 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 | 89 | struct fwnode_handle *fwnode_get_next_child_node( |
| 87 | 90 | const struct fwnode_handle *fwnode, struct fwnode_handle *child); |
| 88 | 91 | struct fwnode_handle *fwnode_get_next_available_child_node( |