Devicetree
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Matti Vaittinen <mazziesaccount@gmail.com>
Cc: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
	Matti Vaittinen <matti.vaittinen@linux.dev>,
	Lee Jones <lee@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney@redhat.com>,
	Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-rtc@vger.kernel.org
Subject: Re: [PATCH 5/8] regulator: bd71828: Support ROHM BD73800
Date: Wed, 1 Jul 2026 14:01:52 +0100	[thread overview]
Message-ID: <bf744d4f-eabe-48e7-92e4-b147b8d79d91@sirena.org.uk> (raw)
In-Reply-To: <1d00359236272fd1fab0dfbcb9119d2f91aa0d23.1782909323.git.mazziesaccount@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1138 bytes --]

On Wed, Jul 01, 2026 at 03:42:35PM +0300, Matti Vaittinen wrote:
> From: Matti Vaittinen <mazziesaccount@gmail.com>

> +	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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2026-07-01 13:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 12:40 [PATCH 0/8] Support ROHM BD73800 Matti Vaittinen
2026-07-01 12:41 ` [PATCH 1/8] dt-bindings: regulator: ROHM BD73800 regulators Matti Vaittinen
2026-07-01 15:39   ` Rob Herring (Arm)
2026-07-01 19:25   ` Rob Herring
2026-07-02  4:45     ` Matti Vaittinen
2026-07-01 12:41 ` [PATCH 2/8] dt-bindings: mfd: ROHM BD73800 PMIC Matti Vaittinen
2026-07-02  8:05   ` Krzysztof Kozlowski
2026-07-02  8:25     ` Matti Vaittinen
2026-07-01 12:41 ` [PATCH 3/8] mfd: Support for ROHM BD73800 PMIC core Matti Vaittinen
2026-07-01 12:42 ` [PATCH 4/8] rtc: bd70528: Support RTC on ROHM BD73800 Matti Vaittinen
2026-07-01 12:55   ` Alexandre Belloni
2026-07-01 12:42 ` [PATCH 5/8] regulator: bd71828: Support " Matti Vaittinen
2026-07-01 13:01   ` Mark Brown [this message]
2026-07-02  4:55     ` Matti Vaittinen
2026-07-01 12:43 ` [PATCH 6/8] clk: bd718x7: " Matti Vaittinen
2026-07-01 12:43 ` [PATCH 7/8] gpio: bd73800: Support ROHM BD73800 PMIC GPIOs Matti Vaittinen
2026-07-01 12:43 ` [PATCH 8/8] MAINTAINERS: Add ROHM BD73800 PMIC files Matti Vaittinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf744d4f-eabe-48e7-92e4-b147b8d79d91@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bmasney@redhat.com \
    --cc=brgl@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=matti.vaittinen@linux.dev \
    --cc=mazziesaccount@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox