From: Rob Herring Date: Fri, 10 Mar 2023 14:47:05 +0000 (-0600) Subject: drm: Use of_property_read_bool() for boolean properties X-Git-Tag: v6.4-rc1~162^2~13^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e27a85c1757655e2e7bd09164b87bf75627e5604;p=thirdparty%2Fkernel%2Flinux.git drm: Use of_property_read_bool() for boolean properties It is preferred to use typed property access functions (i.e. of_property_read_ 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 Link: https://lore.kernel.org/r/20230310144706.1542295-1-robh@kernel.org Signed-off-by: Rob Herring --- diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c index 530ee6a19e7eb..efa80e309b988 100644 --- a/drivers/gpu/drm/bridge/parade-ps8622.c +++ b/drivers/gpu/drm/bridge/parade-ps8622.c @@ -496,7 +496,7 @@ static int ps8622_probe(struct i2c_client *client) 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); diff --git a/drivers/gpu/drm/tiny/ofdrm.c b/drivers/gpu/drm/tiny/ofdrm.c index 6e349ca42485f..76cd7f515bab9 100644 --- a/drivers/gpu/drm/tiny/ofdrm.c +++ b/drivers/gpu/drm/tiny/ofdrm.c @@ -162,13 +162,9 @@ static bool display_get_big_endian_of(struct drm_device *dev, struct device_node 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;