Re: [PATCH v1 4/6] power: Use named initializers for platform_device_id arrays

From: Joshua Peisach

Date: Fri May 29 2026 - 07:40:09 EST


On Fri May 29, 2026 at 6:18 AM EDT, Uwe Kleine-König (The Capable Hub) wrote:
Named initializers are better readable and more robust to changes of the
struct definition. This robustness is relevant for a planned change to
struct platform_device_id replacing .driver_data by an anonymous union.

While touching these arrays unify spacing and usage of commas.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx>
---
drivers/power/reset/spacemit-p1-reboot.c | 4 ++--
drivers/power/reset/tps65086-restart.c | 2 +-
drivers/power/supply/bd71828-power.c | 8 ++++----
drivers/power/supply/macsmc-power.c | 2 +-
drivers/power/supply/max77759_charger.c | 2 +-
drivers/power/supply/max8998_charger.c | 2 +-
drivers/power/supply/pf1550-charger.c | 2 +-
drivers/power/supply/rt5033_charger.c | 2 +-
8 files changed, 12 insertions(+), 12 deletions(-)

[snip]

diff --git a/drivers/power/supply/macsmc-power.c b/drivers/power/supply/macsmc-power.c
index 33ca07460f3a..ced07f71e0a8 100644
--- a/drivers/power/supply/macsmc-power.c
+++ b/drivers/power/supply/macsmc-power.c
@@ -834,7 +834,7 @@ static void macsmc_power_remove(struct platform_device *pdev)
}
static const struct platform_device_id macsmc_power_id[] = {
- { "macsmc-power" },
+ { .name = "macsmc-power" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, macsmc_power_id);

For macsmc-power,

Reviewed-by: Joshua Peisach <jpeisach@xxxxxxxxxx>

(I'm not sure if one can "Review-by" a specific section of a singular
patch, but also the other changes in the patch look fine to me, so
consider it reviewed as well.)