aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/therm_adt746x.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-10 08:47:35 -0600
committerMichael Ellerman <mpe@ellerman.id.au>2023-03-30 23:36:35 +1100
commit87b626a66dd4ab7d5caf5199d98ec0b5953d73f8 (patch)
tree3df00293db9e3379a06a86e3f9307ca9d11d4e12 /drivers/macintosh/therm_adt746x.c
parent4d57e3515e3838b12eccbeb5e0e52f053e3f638a (diff)
downloadlinux-87b626a66dd4ab7d5caf5199d98ec0b5953d73f8.tar.gz
macintosh: 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> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230310144735.1546817-1-robh@kernel.org
Diffstat (limited to 'drivers/macintosh/therm_adt746x.c')
-rw-r--r--drivers/macintosh/therm_adt746x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index 8f5db9093c9af9..384b87d661e1c5 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -483,7 +483,7 @@ static int probe_thermostat(struct i2c_client *client)
if (vers != 1)
return -ENXIO;
- if (of_get_property(np, "hwsensor-location", NULL)) {
+ if (of_property_present(np, "hwsensor-location")) {
for (i = 0; i < 3; i++) {
sensor_location[i] = of_get_property(np,
"hwsensor-location", NULL) + offset;