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>
ps8622->lane_count = ps8622->max_lane_count;
}
- if (!of_find_property(dev->of_node, "use-external-pwm", NULL)) {
+ if (!of_property_read_bool(dev->of_node, "use-external-pwm")) {
ps8622->bl = backlight_device_register("ps8622-backlight",
dev, ps8622, &ps8622_backlight_ops,
NULL);
bool big_endian;
#ifdef __BIG_ENDIAN
- big_endian = true;
- if (of_get_property(of_node, "little-endian", NULL))
- big_endian = false;
+ big_endian = !of_property_read_bool(of_node, "little-endian");
#else
- big_endian = false;
- if (of_get_property(of_node, "big-endian", NULL))
- big_endian = true;
+ big_endian = of_property_read_bool(of_node, "big-endian");
#endif
return big_endian;