summaryrefslogtreecommitdiff
path: root/drivers/regulator/fixed.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-10 17:47:21 +0300
committerMark Brown <broonie@kernel.org>2023-03-11 15:13:38 +0300
commit7dda20c97fac52948b948e15e1173ee57c66ed35 (patch)
tree79d21149869276b9fa9eb85ca83ae5fe1264894c /drivers/regulator/fixed.c
parent4eb6678ab53cac74e71fc5d4e6ff4035e5c847b6 (diff)
downloadlinux-7dda20c97fac52948b948e15e1173ee57c66ed35.tar.xz
regulator: 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/20230310144721.1544756-1-robh@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/fixed.c')
-rw-r--r--drivers/regulator/fixed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 2a9867abba20..7c3add05be15 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -151,7 +151,7 @@ of_get_fixed_voltage_config(struct device *dev,
of_property_read_u32(np, "startup-delay-us", &config->startup_delay);
of_property_read_u32(np, "off-on-delay-us", &config->off_on_delay);
- if (of_find_property(np, "vin-supply", NULL))
+ if (of_property_present(np, "vin-supply"))
config->input_supply = "vin";
return config;