Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: 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 of_property_read_bool().

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20230310144706.1542295-1-robh@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>

+3 -7
+1 -1
drivers/gpu/drm/bridge/parade-ps8622.c
··· 496 496 ps8622->lane_count = ps8622->max_lane_count; 497 497 } 498 498 499 - if (!of_find_property(dev->of_node, "use-external-pwm", NULL)) { 499 + if (!of_property_read_bool(dev->of_node, "use-external-pwm")) { 500 500 ps8622->bl = backlight_device_register("ps8622-backlight", 501 501 dev, ps8622, &ps8622_backlight_ops, 502 502 NULL);
+2 -6
drivers/gpu/drm/tiny/ofdrm.c
··· 162 162 bool big_endian; 163 163 164 164 #ifdef __BIG_ENDIAN 165 - big_endian = true; 166 - if (of_get_property(of_node, "little-endian", NULL)) 167 - big_endian = false; 165 + big_endian = !of_property_read_bool(of_node, "little-endian"); 168 166 #else 169 - big_endian = false; 170 - if (of_get_property(of_node, "big-endian", NULL)) 171 - big_endian = true; 167 + big_endian = of_property_read_bool(of_node, "big-endian"); 172 168 #endif 173 169 174 170 return big_endian;