Skip to contentSkip to conversation

v4l: fwnode: Use fwnode_graph_for_each_endpoint

PATCH In review Sakari Ailus 2 participants 2 messages Dec 21, 2017 – Dec 29, 2017

Subsystems (2)
lore
Share & tools
lore

Sakari Ailus

author maintainer
#0 lore raw

PATCH 1/1 v4l: fwnode: Use fwnode_graph_for_each_endpoint

Use fwnode_graph_for_each_endpoint iterator for better readability.

---
 drivers/media/v4l2-core/v4l2-fwnode.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/v4l2-core/v4l2-fwnode.c +1 -2
index 3cc8b6b69b41..c33d519281a2 100644
@@ -472,8 +472,7 @@ static int __v4l2_async_notifier_parse_fwnode_endpoints(
 	if (WARN_ON(asd_struct_size < sizeof(struct v4l2_async_subdev)))
 		return -EINVAL;
 
-	for (fwnode = NULL; (fwnode = fwnode_graph_get_next_endpoint(
-				     dev_fwnode(dev), fwnode)); ) {
+	fwnode_graph_for_each_endpoint(dev_fwnode(dev), fwnode) {
 		struct fwnode_handle *dev_fwnode;
 		bool is_available;
 
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Sakari,

Thanks for your patch.

Quoted 3 lines · Sakari Ailus

Use fwnode_graph_for_each_endpoint iterator for better readability.

Quoted 22 lines
---
 drivers/media/v4l2-core/v4l2-fwnode.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/v4l2-core/v4l2-fwnode.c +1 -2
index 3cc8b6b69b41..c33d519281a2 100644
@@ -472,8 +472,7 @@ static int __v4l2_async_notifier_parse_fwnode_endpoints(
 	if (WARN_ON(asd_struct_size < sizeof(struct v4l2_async_subdev)))
 		return -EINVAL;
 
-	for (fwnode = NULL; (fwnode = fwnode_graph_get_next_endpoint(
-				     dev_fwnode(dev), fwnode)); ) {
+	fwnode_graph_for_each_endpoint(dev_fwnode(dev), fwnode) {
 		struct fwnode_handle *dev_fwnode;
 		bool is_available;
 
Signature · 1 line
2.11.0
Signature · 2 lines
Regards,
Niklas Söderlund