video: fbdev: offb: switch to using for_each_node_by_type
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 8 Feb 2017 15:43:59 +0000 (16:43 +0100)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Wed, 8 Feb 2017 15:43:59 +0000 (16:43 +0100)
Instead of open-coding loops let's switch to a nice macro.

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Yongji Xie <xyjxie@linux.vnet.ibm.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/offb.c

index 906c6e75c260180705d5bbdd1f6228cd0e0d315d..9be884b0c778b562a699d4ae620d136fa3ae4e2c 100644 (file)
@@ -668,14 +668,14 @@ static int __init offb_init(void)
                offb_init_nodriver(of_chosen, 1);
        }
 
-       for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) {
+       for_each_node_by_type(dp, "display") {
                if (of_get_property(dp, "linux,opened", NULL) &&
                    of_get_property(dp, "linux,boot-display", NULL)) {
                        boot_disp = dp;
                        offb_init_nodriver(dp, 0);
                }
        }
-       for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) {
+       for_each_node_by_type(dp, "display") {
                if (of_get_property(dp, "linux,opened", NULL) &&
                    dp != boot_disp)
                        offb_init_nodriver(dp, 0);