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>
This commit is contained in:
Rob Herring (Arm) 2024-07-31 13:13:02 -06:00 committed by Mark Brown
parent cd7d47c576
commit b03695d952
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
2 changed files with 3 additions and 6 deletions

View File

@ -673,9 +673,7 @@ static int act8865_pmic_probe(struct i2c_client *client)
type = (unsigned long) id->data;
voltage_select = !!of_get_property(dev->of_node,
"active-semi,vsel-high",
NULL);
voltage_select = of_property_read_bool(dev->of_node, "active-semi,vsel-high");
} else {
type = i2c_id->driver_data;
pdata = dev_get_platdata(dev);

View File

@ -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;
}