mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-04 21:57:30 +00:00
device property: Add a macro for interating over graph endpoints
Add a convenience macro for iterating over graph endpoints. Iterating over graph endpoints using fwnode_graph_get_next_endpoint() is a recurring pattern, and this macro allows calling that function in a slightly more convenient way. For instance, for (child = NULL; (child = fwnode_graph_get_next_endpoint(fwnode, child)); ) becomes fwnode_graph_for_each_endpoint(fwnode, child) Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
cf89a31ca5
commit
5e4b1b707b
1 changed files with 4 additions and 0 deletions
|
@ -293,6 +293,10 @@ struct fwnode_handle *
|
||||||
fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port,
|
fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port,
|
||||||
u32 endpoint);
|
u32 endpoint);
|
||||||
|
|
||||||
|
#define fwnode_graph_for_each_endpoint(fwnode, child) \
|
||||||
|
for (child = NULL; \
|
||||||
|
(child = fwnode_graph_get_next_endpoint(fwnode, child)); )
|
||||||
|
|
||||||
int fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
|
int fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
|
||||||
struct fwnode_endpoint *endpoint);
|
struct fwnode_endpoint *endpoint);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue