diff options
author | Rob Herring <robh@kernel.org> | 2023-03-10 17:47:06 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2023-04-19 17:08:31 +0300 |
commit | 914b2fd2cd928f1eccd753e30707800b53acbeec (patch) | |
tree | d66e595ada36fc96d3fea91b286cc9122c05bcbf /drivers/hwmon/ibmpowernv.c | |
parent | 50c3480b6db859ce2c5f524eedb74973342455d0 (diff) | |
download | linux-914b2fd2cd928f1eccd753e30707800b53acbeec.tar.xz |
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/ibmpowernv.c')
-rw-r--r-- | drivers/hwmon/ibmpowernv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c index 8e3724728cce..594254d6a72d 100644 --- a/drivers/hwmon/ibmpowernv.c +++ b/drivers/hwmon/ibmpowernv.c @@ -456,9 +456,9 @@ static int populate_attr_groups(struct platform_device *pdev) */ if (!of_property_read_string(np, "label", &label)) sensor_groups[type].attr_count++; - if (of_find_property(np, "sensor-data-min", NULL)) + if (of_property_present(np, "sensor-data-min")) sensor_groups[type].attr_count++; - if (of_find_property(np, "sensor-data-max", NULL)) + if (of_property_present(np, "sensor-data-max")) sensor_groups[type].attr_count++; } |