drivers: regulator: pca9420: do not use DT_PROP_OR for booleans
DT_PROP() will evaluate to 0 when a boolean property is missing, so there is no need to use DT_PROP_OR(..., false). Using _OR also has side-effects, such as no errors when property is not defined in the bindings. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
f999ab6a09
commit
9f1d25a2d1
1 changed files with 1 additions and 1 deletions
|
@ -579,7 +579,7 @@ static const struct regulator_driver_api api = {
|
||||||
.ilim_reg = DT_PROP_OR(node_id, ilim_reg, 0), \
|
.ilim_reg = DT_PROP_OR(node_id, ilim_reg, 0), \
|
||||||
.ilim_mask = DT_PROP_OR(node_id, ilim_mask, 0), \
|
.ilim_mask = DT_PROP_OR(node_id, ilim_mask, 0), \
|
||||||
.enable_inverted = DT_PROP(node_id, enable_inverted), \
|
.enable_inverted = DT_PROP(node_id, enable_inverted), \
|
||||||
.boot_on = DT_PROP_OR(node_id, regulator_boot_on, false), \
|
.boot_on = DT_PROP(node_id, regulator_boot_on), \
|
||||||
.num_modes = ARRAY_SIZE(allowed_modes_##ord), \
|
.num_modes = ARRAY_SIZE(allowed_modes_##ord), \
|
||||||
.initial_mode = DT_PROP_OR(DT_PARENT(node_id), \
|
.initial_mode = DT_PROP_OR(DT_PARENT(node_id), \
|
||||||
regulator_initial_mode, 0), \
|
regulator_initial_mode, 0), \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue