@@ -1455,17 +1455,18 @@ static int __maybe_unused vi_runtime_suspend(struct device *dev)
14551455}
14561456
14571457/*
1458- * Graph Management
1458+ * Find the entity matching a given fwnode in an v4l2_async_notifier list
14591459 */
14601460static struct tegra_vi_graph_entity *
1461- tegra_vi_graph_find_entity (struct tegra_vi_channel * chan ,
1461+ tegra_vi_graph_find_entity (struct list_head * list ,
14621462 const struct fwnode_handle * fwnode )
14631463{
14641464 struct tegra_vi_graph_entity * entity ;
14651465 struct v4l2_async_connection * asd ;
14661466
1467- list_for_each_entry (asd , & chan -> notifier . done_list , asc_entry ) {
1467+ list_for_each_entry (asd , list , asc_entry ) {
14681468 entity = to_tegra_vi_graph_entity (asd );
1469+
14691470 if (entity -> asd .match .fwnode == fwnode )
14701471 return entity ;
14711472 }
@@ -1532,7 +1533,8 @@ static int tegra_vi_graph_build(struct tegra_vi_channel *chan,
15321533 }
15331534
15341535 /* find the remote entity from notifier list */
1535- ent = tegra_vi_graph_find_entity (chan , link .remote_node );
1536+ ent = tegra_vi_graph_find_entity (& chan -> notifier .done_list ,
1537+ link .remote_node );
15361538 if (!ent ) {
15371539 dev_err (vi -> dev , "no entity found for %pOF\n" ,
15381540 to_of_node (link .remote_node ));
@@ -1664,7 +1666,8 @@ static int tegra_vi_graph_notify_bound(struct v4l2_async_notifier *notifier,
16641666 * Locate the entity corresponding to the bound subdev and store the
16651667 * subdev pointer.
16661668 */
1667- entity = tegra_vi_graph_find_entity (chan , subdev -> fwnode );
1669+ entity = tegra_vi_graph_find_entity (& chan -> notifier .waiting_list ,
1670+ subdev -> fwnode );
16681671 if (!entity ) {
16691672 dev_err (vi -> dev , "no entity for subdev %s\n" , subdev -> name );
16701673 return - EINVAL ;
@@ -1713,7 +1716,8 @@ static int tegra_vi_graph_parse_one(struct tegra_vi_channel *chan,
17131716
17141717 /* skip entities that are already processed */
17151718 if (device_match_fwnode (vi -> dev , remote ) ||
1716- tegra_vi_graph_find_entity (chan , remote )) {
1719+ tegra_vi_graph_find_entity (& chan -> notifier .waiting_list ,
1720+ remote )) {
17171721 fwnode_handle_put (remote );
17181722 continue ;
17191723 }
0 commit comments