Skip to content

Commit 096dc32

Browse files
robherringhdeller
authored andcommitted
fbdev: Use of_property_read_bool() for boolean properties
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to of_property_read_bool(). Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 7eb1220 commit 096dc32

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

drivers/video/fbdev/offb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,10 +549,10 @@ static void offb_init_nodriver(struct platform_device *parent, struct device_nod
549549
int foreign_endian = 0;
550550

551551
#ifdef __BIG_ENDIAN
552-
if (of_get_property(dp, "little-endian", NULL))
552+
if (of_property_read_bool(dp, "little-endian"))
553553
foreign_endian = FBINFO_FOREIGN_ENDIAN;
554554
#else
555-
if (of_get_property(dp, "big-endian", NULL))
555+
if (of_property_read_bool(dp, "big-endian"))
556556
foreign_endian = FBINFO_FOREIGN_ENDIAN;
557557
#endif
558558

drivers/video/fbdev/sm501fb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,10 +1737,10 @@ static int sm501fb_init_fb(struct fb_info *fb, enum sm501_controller head,
17371737

17381738
#if defined(CONFIG_OF)
17391739
#ifdef __BIG_ENDIAN
1740-
if (of_get_property(info->dev->parent->of_node, "little-endian", NULL))
1740+
if (of_property_read_bool(info->dev->parent->of_node, "little-endian"))
17411741
fb->flags |= FBINFO_FOREIGN_ENDIAN;
17421742
#else
1743-
if (of_get_property(info->dev->parent->of_node, "big-endian", NULL))
1743+
if (of_property_read_bool(info->dev->parent->of_node, "big-endian"))
17441744
fb->flags |= FBINFO_FOREIGN_ENDIAN;
17451745
#endif
17461746
#endif

drivers/video/fbdev/tcx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,7 @@ static int tcx_probe(struct platform_device *op)
379379

380380
spin_lock_init(&par->lock);
381381

382-
par->lowdepth =
383-
(of_find_property(dp, "tcx-8-bit", NULL) != NULL);
382+
par->lowdepth = of_property_read_bool(dp, "tcx-8-bit");
384383

385384
sbusfb_fill_var(&info->var, dp, 8);
386385
info->var.red.length = 8;

drivers/video/fbdev/xilinxfb.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,7 @@ static int xilinxfb_of_probe(struct platform_device *pdev)
469469
pdata.yvirt = prop[1];
470470
}
471471

472-
if (of_find_property(pdev->dev.of_node, "rotate-display", NULL))
473-
pdata.rotate_screen = 1;
472+
pdata.rotate_screen = of_property_read_bool(pdev->dev.of_node, "rotate-display");
474473

475474
platform_set_drvdata(pdev, drvdata);
476475
return xilinxfb_assign(pdev, drvdata, &pdata);

0 commit comments

Comments
 (0)