drm: Using for_each_available_child_of_node to simplify code logic
Subsystems (3)
PATCH 1/1 drm: Using for_each_available_child_of_node to simplify code logic
The while loop of of_get_next_available_child() can be replaced by for_each_available_child_of_node(). Using this helper function to make code logic more simple.
Signed-off-by Zhang Zekun <[email protected]>
--- drivers/gpu/drm/sti/sti_drv.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/sti/sti_drv.c +1 -5
@@ -239,13 +239,9 @@ static int sti_platform_probe(struct platform_device *pdev)devm_of_platform_populate (dev); - child_np =of_get_next_available_child (node,NULL ); - -while (child_np) { +for_each_available_child_of_node (node, child_np)drm_of_component_match_add (dev, &match, component_compare_of, child_np); - child_np =of_get_next_available_child (node, child_np); - }return component_master_add_with_match (dev, &sti_ops, match); }
Signature · 1 line
2.17.1