power: Use named initializers for platform_device_id arrays

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@baylibre.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Joshua Peisach <jpeisach@ubuntu.com>
Link: https://patch.msgid.link/1ceacf4f9c3f827bcad85b378aa04cdca1c04635.1780048925.git.u.kleine-koenig@baylibre.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
Uwe Kleine-König (The Capable Hub)
2026-05-29 12:18:19 +02:00
committed by Sebastian Reichel
parent 37258ad1f3
commit e28f7498dd
8 changed files with 12 additions and 12 deletions

View File

@@ -70,8 +70,8 @@ static int spacemit_p1_reboot_probe(struct platform_device *pdev)
}
static const struct platform_device_id spacemit_p1_reboot_id_table[] = {
{ "spacemit-p1-reboot", },
{ /* sentinel */ },
{ .name = "spacemit-p1-reboot" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, spacemit_p1_reboot_id_table);

View File

@@ -41,7 +41,7 @@ static int tps65086_restart_probe(struct platform_device *pdev)
}
static const struct platform_device_id tps65086_restart_id_table[] = {
{ "tps65086-reset", },
{ .name = "tps65086-reset" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, tps65086_restart_id_table);

View File

@@ -1184,10 +1184,10 @@ static int bd71828_power_probe(struct platform_device *pdev)
}
static const struct platform_device_id bd71828_charger_id[] = {
{ "bd71815-power", ROHM_CHIP_TYPE_BD71815 },
{ "bd71828-power", ROHM_CHIP_TYPE_BD71828 },
{ "bd72720-power", ROHM_CHIP_TYPE_BD72720 },
{ },
{ .name = "bd71815-power", .driver_data = ROHM_CHIP_TYPE_BD71815 },
{ .name = "bd71828-power", .driver_data = ROHM_CHIP_TYPE_BD71828 },
{ .name = "bd72720-power", .driver_data = ROHM_CHIP_TYPE_BD72720 },
{ }
};
MODULE_DEVICE_TABLE(platform, bd71828_charger_id);

View File

@@ -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);

View File

@@ -754,7 +754,7 @@ static int max77759_charger_probe(struct platform_device *pdev)
}
static const struct platform_device_id max77759_charger_id[] = {
{ .name = "max77759-charger", },
{ .name = "max77759-charger" },
{ }
};
MODULE_DEVICE_TABLE(platform, max77759_charger_id);

View File

@@ -188,7 +188,7 @@ static int max8998_battery_probe(struct platform_device *pdev)
}
static const struct platform_device_id max8998_battery_id[] = {
{ "max8998-battery", TYPE_MAX8998 },
{ .name = "max8998-battery" },
{ }
};
MODULE_DEVICE_TABLE(platform, max8998_battery_id);

View File

@@ -622,7 +622,7 @@ static int pf1550_charger_probe(struct platform_device *pdev)
}
static const struct platform_device_id pf1550_charger_id[] = {
{ "pf1550-charger", },
{ .name = "pf1550-charger" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, pf1550_charger_id);

View File

@@ -727,7 +727,7 @@ static int rt5033_charger_probe(struct platform_device *pdev)
}
static const struct platform_device_id rt5033_charger_id[] = {
{ "rt5033-charger", },
{ .name = "rt5033-charger" },
{ }
};
MODULE_DEVICE_TABLE(platform, rt5033_charger_id);