power: supply: surface_{battery,charger}: Consistently define ssam_device_ids using named initializers

The .driver_data member of the the two struct ssam_device_id arrays were
initialized by list expressions. This isn't easily readable if you don't
work with the Surface System Aggregator core regularily. Using named
initializers is more explicit and thus easier to parse and also more
robust to changes of the struct definition. This robustness is relevant
for a planned change to struct ssam_device_id replacing .driver_data
by an anonymous union.

While touching these arrays, also drop the comma after the list
terminators.

This change doesn't introduce changes to the compiled ssam_device_id
arrays.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://patch.msgid.link/bc8eff03b2f36c82af5a75fc7114c277228921db.1781526433.git.u.kleine-koenig@baylibre.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
Uwe Kleine-König (The Capable Hub) 2026-06-15 14:51:37 +02:00 committed by Ilpo Järvinen
parent 613550ffe3
commit 4340038998
No known key found for this signature in database
GPG Key ID: 59AC4F6153E5CE31
2 changed files with 13 additions and 5 deletions

View File

@ -852,9 +852,14 @@ static const struct spwr_psy_properties spwr_psy_props_bat2_sb3 = {
};
static const struct ssam_device_id surface_battery_match[] = {
{ SSAM_SDEV(BAT, SAM, 0x01, 0x00), (unsigned long)&spwr_psy_props_bat1 },
{ SSAM_SDEV(BAT, KIP, 0x01, 0x00), (unsigned long)&spwr_psy_props_bat2_sb3 },
{ },
{
SSAM_SDEV(BAT, SAM, 0x01, 0x00),
.driver_data = (unsigned long)&spwr_psy_props_bat1,
}, {
SSAM_SDEV(BAT, KIP, 0x01, 0x00),
.driver_data = (unsigned long)&spwr_psy_props_bat2_sb3,
},
{ }
};
MODULE_DEVICE_TABLE(ssam, surface_battery_match);

View File

@ -260,8 +260,11 @@ static const struct spwr_psy_properties spwr_psy_props_adp1 = {
};
static const struct ssam_device_id surface_ac_match[] = {
{ SSAM_SDEV(BAT, SAM, 0x01, 0x01), (unsigned long)&spwr_psy_props_adp1 },
{ },
{
SSAM_SDEV(BAT, SAM, 0x01, 0x01),
.driver_data = (unsigned long)&spwr_psy_props_adp1,
},
{ }
};
MODULE_DEVICE_TABLE(ssam, surface_ac_match);