Re: [PATCH 5/8] regulator: bd71828: Support ROHM BD73800
From: Mark Brown
Date: Wed Jul 01 2026 - 09:43:17 EST
On Wed, Jul 01, 2026 at 03:42:35PM +0300, Matti Vaittinen wrote:
> From: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
> + nproot = of_get_child_by_name(nproot, "regulators");
> + if (!nproot) {
> + dev_err(dev, "failed to find regulators node\n");
> + return -ENODEV;
> + }
> + for_each_child_of_node(nproot, np) {
> + if (of_node_name_eq(np, LDO1_NODE_NAME))
> + ldo1_use_high_range = of_property_read_bool(np,
> + "rohm,ldo-range-high");
> + if (of_node_name_eq(np, LDO3_NODE_NAME))
> + ldo3_use_high_range = of_property_read_bool(np,
> + "rohm,ldo-range-high");
> + }
Why do we iterate over all nodes rather than doing additional
of_get_child_by_name()s?
> + if (ldo1_use_high_range) {
> + d[BD73800_LDO1].desc.linear_ranges = bd73800_ldo13_high_volts;
> + d[BD73800_LDO1].desc.n_linear_ranges =
> + ARRAY_SIZE(bd73800_ldo13_high_volts);
> + }
> + if (ldo3_use_high_range) {
> + d[BD73800_LDO3].desc.linear_ranges = bd73800_ldo13_high_volts;
> + d[BD73800_LDO3].desc.n_linear_ranges =
> + ARRAY_SIZE(bd73800_ldo13_high_volts);
> + }
You could just do these updates without the intermediate variables.
Attachment:
signature.asc
Description: PGP signature