Skip to content

Commit e28f749

Browse files
ukleineksre
authored andcommitted
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>
1 parent 37258ad commit e28f749

8 files changed

Lines changed: 12 additions & 12 deletions

File tree

drivers/power/reset/spacemit-p1-reboot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ static int spacemit_p1_reboot_probe(struct platform_device *pdev)
7070
}
7171

7272
static const struct platform_device_id spacemit_p1_reboot_id_table[] = {
73-
{ "spacemit-p1-reboot", },
74-
{ /* sentinel */ },
73+
{ .name = "spacemit-p1-reboot" },
74+
{ /* sentinel */ }
7575
};
7676
MODULE_DEVICE_TABLE(platform, spacemit_p1_reboot_id_table);
7777

drivers/power/reset/tps65086-restart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static int tps65086_restart_probe(struct platform_device *pdev)
4141
}
4242

4343
static const struct platform_device_id tps65086_restart_id_table[] = {
44-
{ "tps65086-reset", },
44+
{ .name = "tps65086-reset" },
4545
{ /* sentinel */ }
4646
};
4747
MODULE_DEVICE_TABLE(platform, tps65086_restart_id_table);

drivers/power/supply/bd71828-power.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,10 +1184,10 @@ static int bd71828_power_probe(struct platform_device *pdev)
11841184
}
11851185

11861186
static const struct platform_device_id bd71828_charger_id[] = {
1187-
{ "bd71815-power", ROHM_CHIP_TYPE_BD71815 },
1188-
{ "bd71828-power", ROHM_CHIP_TYPE_BD71828 },
1189-
{ "bd72720-power", ROHM_CHIP_TYPE_BD72720 },
1190-
{ },
1187+
{ .name = "bd71815-power", .driver_data = ROHM_CHIP_TYPE_BD71815 },
1188+
{ .name = "bd71828-power", .driver_data = ROHM_CHIP_TYPE_BD71828 },
1189+
{ .name = "bd72720-power", .driver_data = ROHM_CHIP_TYPE_BD72720 },
1190+
{ }
11911191
};
11921192
MODULE_DEVICE_TABLE(platform, bd71828_charger_id);
11931193

drivers/power/supply/macsmc-power.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ static void macsmc_power_remove(struct platform_device *pdev)
834834
}
835835

836836
static const struct platform_device_id macsmc_power_id[] = {
837-
{ "macsmc-power" },
837+
{ .name = "macsmc-power" },
838838
{ /* sentinel */ }
839839
};
840840
MODULE_DEVICE_TABLE(platform, macsmc_power_id);

drivers/power/supply/max77759_charger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ static int max77759_charger_probe(struct platform_device *pdev)
754754
}
755755

756756
static const struct platform_device_id max77759_charger_id[] = {
757-
{ .name = "max77759-charger", },
757+
{ .name = "max77759-charger" },
758758
{ }
759759
};
760760
MODULE_DEVICE_TABLE(platform, max77759_charger_id);

drivers/power/supply/max8998_charger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static int max8998_battery_probe(struct platform_device *pdev)
188188
}
189189

190190
static const struct platform_device_id max8998_battery_id[] = {
191-
{ "max8998-battery", TYPE_MAX8998 },
191+
{ .name = "max8998-battery" },
192192
{ }
193193
};
194194
MODULE_DEVICE_TABLE(platform, max8998_battery_id);

drivers/power/supply/pf1550-charger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ static int pf1550_charger_probe(struct platform_device *pdev)
622622
}
623623

624624
static const struct platform_device_id pf1550_charger_id[] = {
625-
{ "pf1550-charger", },
625+
{ .name = "pf1550-charger" },
626626
{ /* sentinel */ }
627627
};
628628
MODULE_DEVICE_TABLE(platform, pf1550_charger_id);

drivers/power/supply/rt5033_charger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ static int rt5033_charger_probe(struct platform_device *pdev)
727727
}
728728

729729
static const struct platform_device_id rt5033_charger_id[] = {
730-
{ "rt5033-charger", },
730+
{ .name = "rt5033-charger" },
731731
{ }
732732
};
733733
MODULE_DEVICE_TABLE(platform, rt5033_charger_id);

0 commit comments

Comments
 (0)