From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Michael Hennerich <michael.hennerich@analog.com>,
Support Opensource <support.opensource@diasemi.com>,
Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>,
Claudiu Beznea <claudiu.beznea@tuxon.dev>,
Andrei Simion <andrei.simion@microchip.com>,
Saravanan Sekar <sravanhome@gmail.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Woodrow Douglass <wdouglass@carnegierobotics.com>,
Jagan Teki <jagan@amarulasolutions.com>,
Icenowy Zheng <icenowy@aosc.io>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v2 2/2] regulator: Use named initializers for arrays of i2c_device_data
Date: Tue, 19 May 2026 12:07:00 +0200 [thread overview]
Message-ID: <20260519100700.GC45952@killaraus.ideasonboard.com> (raw)
In-Reply-To: <9a8bfc7286221873ef02eeba0727eeaeb9e504e8.1779184320.git.u.kleine-koenig@baylibre.com>
On Tue, May 19, 2026 at 11:57:51AM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> While being less compact, using named initializers allows to more easily
> see which members of the structs are assigned which value without having
> to lookup the declaration of the struct. And it's also more robust
> against changes to the struct definition.
>
> The mentioned robustness is relevant for a planned change to struct
> i2c_device_id that replaces .driver_data by an anonymous union.
>
> While touching all these arrays, unify usage of whitespace and commas.
>
> This patch doesn't modify the compiled arrays, only their representation
> in source form benefits. The former was confirmed with x86 and arm64
> builds.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
> ---
> drivers/regulator/88pg86x.c | 4 +--
> drivers/regulator/ad5398.c | 4 +--
> drivers/regulator/da9121-regulator.c | 20 +++++++--------
> drivers/regulator/da9210-regulator.c | 4 +--
> drivers/regulator/da9211-regulator.c | 18 +++++++-------
> drivers/regulator/fan53880.c | 4 +--
> drivers/regulator/isl9305.c | 4 +--
> drivers/regulator/lp3971.c | 2 +-
> drivers/regulator/lp3972.c | 2 +-
> drivers/regulator/lp872x.c | 34 +++++++++++++-------------
> drivers/regulator/lp8755.c | 4 +--
> drivers/regulator/ltc3589.c | 6 ++---
> drivers/regulator/ltc3676.c | 2 +-
> drivers/regulator/max1586.c | 2 +-
> drivers/regulator/max20086-regulator.c | 8 +++---
> drivers/regulator/max20411-regulator.c | 2 +-
> drivers/regulator/max77503-regulator.c | 2 +-
> drivers/regulator/max77675-regulator.c | 2 +-
> drivers/regulator/max77826-regulator.c | 2 +-
> drivers/regulator/max77838-regulator.c | 2 +-
> drivers/regulator/max77857-regulator.c | 8 +++---
> drivers/regulator/max8649.c | 2 +-
> drivers/regulator/max8893.c | 2 +-
> drivers/regulator/max8952.c | 2 +-
> drivers/regulator/mcp16502.c | 2 +-
> drivers/regulator/mp5416.c | 6 ++---
> drivers/regulator/mp8859.c | 4 +--
> drivers/regulator/mp886x.c | 6 ++---
> drivers/regulator/mpq7920.c | 4 +--
> drivers/regulator/mt6311-regulator.c | 4 +--
> drivers/regulator/pf530x-regulator.c | 6 ++---
> drivers/regulator/pf8x00-regulator.c | 8 +++---
> drivers/regulator/pv88060-regulator.c | 4 +--
> drivers/regulator/pv88080-regulator.c | 8 +++---
> drivers/regulator/pv88090-regulator.c | 4 +--
> drivers/regulator/slg51000-regulator.c | 4 +--
> drivers/regulator/sy8106a-regulator.c | 2 +-
> drivers/regulator/sy8824x.c | 8 +++---
> drivers/regulator/sy8827n.c | 4 +--
> drivers/regulator/tps6286x-regulator.c | 10 ++++----
> drivers/regulator/tps6287x-regulator.c | 10 ++++----
> 41 files changed, 118 insertions(+), 118 deletions(-)
[snip]
> diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c
> index 942f37082cb1..779df653338a 100644
> --- a/drivers/regulator/lp872x.c
> +++ b/drivers/regulator/lp872x.c
> @@ -796,24 +796,24 @@ static const struct regmap_config lp872x_regmap_config = {
> #define LP872X_VALID_OPMODE (REGULATOR_MODE_FAST | REGULATOR_MODE_NORMAL)
>
> static struct of_regulator_match lp8720_matches[] = {
This is unrelated to the commit message that only mentions
i2c_device_id.
With this chunk dropped,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> - { .name = "ldo1", .driver_data = (void *)LP8720_ID_LDO1, },
> - { .name = "ldo2", .driver_data = (void *)LP8720_ID_LDO2, },
> - { .name = "ldo3", .driver_data = (void *)LP8720_ID_LDO3, },
> - { .name = "ldo4", .driver_data = (void *)LP8720_ID_LDO4, },
> - { .name = "ldo5", .driver_data = (void *)LP8720_ID_LDO5, },
> - { .name = "buck", .driver_data = (void *)LP8720_ID_BUCK, },
> + { .name = "ldo1", .driver_data = (void *)LP8720_ID_LDO1 },
> + { .name = "ldo2", .driver_data = (void *)LP8720_ID_LDO2 },
> + { .name = "ldo3", .driver_data = (void *)LP8720_ID_LDO3 },
> + { .name = "ldo4", .driver_data = (void *)LP8720_ID_LDO4 },
> + { .name = "ldo5", .driver_data = (void *)LP8720_ID_LDO5 },
> + { .name = "buck", .driver_data = (void *)LP8720_ID_BUCK },
> };
>
> static struct of_regulator_match lp8725_matches[] = {
> - { .name = "ldo1", .driver_data = (void *)LP8725_ID_LDO1, },
> - { .name = "ldo2", .driver_data = (void *)LP8725_ID_LDO2, },
> - { .name = "ldo3", .driver_data = (void *)LP8725_ID_LDO3, },
> - { .name = "ldo4", .driver_data = (void *)LP8725_ID_LDO4, },
> - { .name = "ldo5", .driver_data = (void *)LP8725_ID_LDO5, },
> - { .name = "lilo1", .driver_data = (void *)LP8725_ID_LILO1, },
> - { .name = "lilo2", .driver_data = (void *)LP8725_ID_LILO2, },
> - { .name = "buck1", .driver_data = (void *)LP8725_ID_BUCK1, },
> - { .name = "buck2", .driver_data = (void *)LP8725_ID_BUCK2, },
> + { .name = "ldo1", .driver_data = (void *)LP8725_ID_LDO1 },
> + { .name = "ldo2", .driver_data = (void *)LP8725_ID_LDO2 },
> + { .name = "ldo3", .driver_data = (void *)LP8725_ID_LDO3 },
> + { .name = "ldo4", .driver_data = (void *)LP8725_ID_LDO4 },
> + { .name = "ldo5", .driver_data = (void *)LP8725_ID_LDO5 },
> + { .name = "lilo1", .driver_data = (void *)LP8725_ID_LILO1 },
> + { .name = "lilo2", .driver_data = (void *)LP8725_ID_LILO2 },
> + { .name = "buck1", .driver_data = (void *)LP8725_ID_BUCK1 },
> + { .name = "buck2", .driver_data = (void *)LP8725_ID_BUCK2 },
> };
>
> static struct lp872x_platform_data
> @@ -935,8 +935,8 @@ static const struct of_device_id lp872x_dt_ids[] __maybe_unused = {
> MODULE_DEVICE_TABLE(of, lp872x_dt_ids);
>
> static const struct i2c_device_id lp872x_ids[] = {
> - {"lp8720", LP8720},
> - {"lp8725", LP8725},
> + { .name = "lp8720", .driver_data = LP8720 },
> + { .name = "lp8725", .driver_data = LP8725 },
> { }
> };
> MODULE_DEVICE_TABLE(i2c, lp872x_ids);
[snip]
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2026-05-19 10:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 9:57 [PATCH v2 0/2] regulator: Rework i2c_device_id initialisation Uwe Kleine-König (The Capable Hub)
2026-05-19 9:57 ` [PATCH v2 2/2] regulator: Use named initializers for arrays of i2c_device_data Uwe Kleine-König (The Capable Hub)
2026-05-19 10:07 ` Laurent Pinchart [this message]
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=20260519100700.GC45952@killaraus.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=andrei.simion@microchip.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=broonie@kernel.org \
--cc=claudiu.beznea@tuxon.dev \
--cc=icenowy@aosc.io \
--cc=ivo.ivanov.ivanov1@gmail.com \
--cc=jagan@amarulasolutions.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=michael.hennerich@analog.com \
--cc=sravanhome@gmail.com \
--cc=support.opensource@diasemi.com \
--cc=u.kleine-koenig@baylibre.com \
--cc=wdouglass@carnegierobotics.com \
/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