[PATCH] drm: Using for_each_available_child_of_node to simplify code logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <zhangzekun11@xxxxxxxxxx>
---
 drivers/gpu/drm/sti/sti_drv.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 1799c12babf5..3a2cf3dc880f 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -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);
 }
-- 
2.17.1




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux