Skip to content

Commit 0d82017

Browse files
Sakari Ailusrafaeljw
authored andcommitted
device property: Use fwnode_graph_for_each_endpoint() macro
Now that we have fwnode_graph_for_each_endpoint() macro, use it instead of calling fwnode_graph_get_next_endpoint() directly. It manages the iterator variable for the user without manual intervention. Signed-off-by: Sakari Ailus <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent c87b8fc commit 0d82017

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/base/property.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,9 +1024,9 @@ struct fwnode_handle *
10241024
fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port_id,
10251025
u32 endpoint_id)
10261026
{
1027-
struct fwnode_handle *endpoint = NULL;
1027+
struct fwnode_handle *endpoint;
10281028

1029-
while ((endpoint = fwnode_graph_get_next_endpoint(fwnode, endpoint))) {
1029+
fwnode_graph_for_each_endpoint(fwnode, endpoint) {
10301030
struct fwnode_endpoint fwnode_ep;
10311031
struct fwnode_handle *remote;
10321032
int ret;
@@ -1085,12 +1085,12 @@ struct fwnode_handle *
10851085
fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
10861086
u32 port, u32 endpoint, unsigned long flags)
10871087
{
1088-
struct fwnode_handle *ep = NULL, *best_ep = NULL;
1088+
struct fwnode_handle *ep, *best_ep = NULL;
10891089
unsigned int best_ep_id = 0;
10901090
bool endpoint_next = flags & FWNODE_GRAPH_ENDPOINT_NEXT;
10911091
bool enabled_only = !(flags & FWNODE_GRAPH_DEVICE_DISABLED);
10921092

1093-
while ((ep = fwnode_graph_get_next_endpoint(fwnode, ep))) {
1093+
fwnode_graph_for_each_endpoint(fwnode, ep) {
10941094
struct fwnode_endpoint fwnode_ep = { 0 };
10951095
int ret;
10961096

0 commit comments

Comments
 (0)