Skip to content

Commit 29413f0

Browse files
robherringhdeller
authored andcommitted
fbdev: Use of_property_present() for testing DT property presence
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. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more. Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 44a3b36 commit 29413f0

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

drivers/video/fbdev/amba-clcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ static struct clcd_board *clcdfb_of_get_board(struct amba_device *dev)
854854
board->caps = CLCD_CAP_ALL;
855855
board->check = clcdfb_check;
856856
board->decode = clcdfb_decode;
857-
if (of_find_property(node, "memory-region", NULL)) {
857+
if (of_property_present(node, "memory-region")) {
858858
board->setup = clcdfb_of_vram_setup;
859859
board->mmap = clcdfb_of_vram_mmap;
860860
board->remove = clcdfb_of_vram_remove;

drivers/video/fbdev/bw2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ static int bw2_probe(struct platform_device *op)
306306
if (!par->regs)
307307
goto out_release_fb;
308308

309-
if (!of_find_property(dp, "width", NULL)) {
309+
if (!of_property_present(dp, "width")) {
310310
err = bw2_do_default_mode(par, info, &linebytes);
311311
if (err)
312312
goto out_unmap_regs;

drivers/video/fbdev/cg3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ static int cg3_probe(struct platform_device *op)
393393

394394
cg3_blank(FB_BLANK_UNBLANK, info);
395395

396-
if (!of_find_property(dp, "width", NULL)) {
396+
if (!of_property_present(dp, "width")) {
397397
err = cg3_do_default_mode(par);
398398
if (err)
399399
goto out_unmap_screen;

drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static int __init omapdss_boot_init(void)
192192
omapdss_walk_device(dss, true);
193193

194194
for_each_available_child_of_node(dss, child) {
195-
if (!of_find_property(child, "compatible", NULL))
195+
if (!of_property_present(child, "compatible"))
196196
continue;
197197

198198
omapdss_walk_device(child, true);

0 commit comments

Comments
 (0)