diff options
author | Rob Herring <robh@kernel.org> | 2023-03-10 15:47:21 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-03-11 13:13:38 +0100 |
commit | 7dda20c97fac52948b948e15e1173ee57c66ed35 (patch) | |
tree | 79d21149869276b9fa9eb85ca83ae5fe1264894c /drivers/regulator/bd71815-regulator.c | |
parent | regulator: rt5739: Spelling s/Rcihtek/Richtek/ (diff) | |
download | linux-7dda20c97fac52948b948e15e1173ee57c66ed35.tar.xz linux-7dda20c97fac52948b948e15e1173ee57c66ed35.zip |
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/bd71815-regulator.c')
-rw-r--r-- | drivers/regulator/bd71815-regulator.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/regulator/bd71815-regulator.c b/drivers/regulator/bd71815-regulator.c index 8b55046eded8..f4eaea732de7 100644 --- a/drivers/regulator/bd71815-regulator.c +++ b/drivers/regulator/bd71815-regulator.c @@ -201,10 +201,10 @@ static int buck12_set_hw_dvs_levels(struct device_node *np, data = container_of(desc, struct bd71815_regulator, desc); - if (of_find_property(np, "rohm,dvs-run-voltage", NULL) || - of_find_property(np, "rohm,dvs-suspend-voltage", NULL) || - of_find_property(np, "rohm,dvs-lpsr-voltage", NULL) || - of_find_property(np, "rohm,dvs-snvs-voltage", NULL)) { + if (of_property_present(np, "rohm,dvs-run-voltage") || + of_property_present(np, "rohm,dvs-suspend-voltage") || + of_property_present(np, "rohm,dvs-lpsr-voltage") || + of_property_present(np, "rohm,dvs-snvs-voltage")) { ret = regmap_read(cfg->regmap, desc->vsel_reg, &val); if (ret) return ret; |