diff options
author | Rob Herring (Arm) <robh@kernel.org> | 2024-07-31 13:13:02 -0600 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-08-01 12:50:11 +0100 |
commit | b03695d95213121719f05cbf6f3baa1ad3667e7f (patch) | |
tree | eda5e1fcfd7315122e74caf06a5b66adc0c24ecf /drivers/regulator/max8997-regulator.c | |
parent | cd7d47c5762997a2b1de57a47cd48a1cdad38d96 (diff) |
regulator: Use of_property_read_bool()
Use of_property_read_bool() to read boolean properties rather than
of_get_property(). This is part of a larger effort to remove callers
of of_get_property() and similar functions. of_get_property() leaks
the DT property data pointer which is a problem for dynamically
allocated nodes which may be freed.
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240731191312.1710417-24-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/max8997-regulator.c')
-rw-r--r-- | drivers/regulator/max8997-regulator.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/regulator/max8997-regulator.c b/drivers/regulator/max8997-regulator.c index 5f201ee9a5b8..cdbfb4561dd8 100644 --- a/drivers/regulator/max8997-regulator.c +++ b/drivers/regulator/max8997-regulator.c @@ -941,9 +941,8 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, } } - if (of_get_property(pmic_np, - "max8997,pmic-ignore-gpiodvs-side-effect", NULL)) - pdata->ignore_gpiodvs_side_effect = true; + pdata->ignore_gpiodvs_side_effect = of_property_read_bool(pmic_np, + "max8997,pmic-ignore-gpiodvs-side-effect"); dvs_voltage_nr = 8; } |