summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pwm-fan.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-10 15:47:06 +0100
committerGuenter Roeck <linux@roeck-us.net>2023-04-19 16:08:31 +0200
commit914b2fd2cd928f1eccd753e30707800b53acbeec (patch)
treed66e595ada36fc96d3fea91b286cc9122c05bcbf /drivers/hwmon/pwm-fan.c
parenthwmon: (ltc4245) Use of_property_read_bool() for boolean properties (diff)
downloadlinux-914b2fd2cd928f1eccd753e30707800b53acbeec.tar.xz
linux-914b2fd2cd928f1eccd753e30707800b53acbeec.zip
hwmon: (ibmpowernv, pwm-fan) 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 <robh@kernel.org> Link: https://lore.kernel.org/r/20230310144706.1542434-1-robh@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/pwm-fan.c')
-rw-r--r--drivers/hwmon/pwm-fan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
index 83a347ca35da..57928d270015 100644
--- a/drivers/hwmon/pwm-fan.c
+++ b/drivers/hwmon/pwm-fan.c
@@ -427,7 +427,7 @@ static int pwm_fan_of_get_cooling_data(struct device *dev,
struct device_node *np = dev->of_node;
int num, i, ret;
- if (!of_find_property(np, "cooling-levels", NULL))
+ if (!of_property_present(np, "cooling-levels"))
return 0;
ret = of_property_count_u32_elems(np, "cooling-levels");