mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 03:27:30 -04:00
hwmon: 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 unit. While touching these arrays unify usage of commas. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Link: https://lore.kernel.org/r/25d38df8db42d69f33fa30267c9fd5ea058223d0.1779894738.git.u.kleine-koenig@baylibre.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
committed by
Guenter Roeck
parent
acac4eb97a
commit
d12bcf7d41
@@ -321,8 +321,8 @@ static void max197_remove(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
static const struct platform_device_id max197_device_ids[] = {
|
||||
{ "max197", max197 },
|
||||
{ "max199", max199 },
|
||||
{ .name = "max197", .driver_data = max197 },
|
||||
{ .name = "max199", .driver_data = max199 },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(platform, max197_device_ids);
|
||||
|
||||
@@ -52,18 +52,18 @@ enum {
|
||||
};
|
||||
|
||||
static const struct platform_device_id ntc_thermistor_id[] = {
|
||||
[NTC_B57330V2103] = { "b57330v2103", TYPE_B57330V2103 },
|
||||
[NTC_B57891S0103] = { "b57891s0103", TYPE_B57891S0103 },
|
||||
[NTC_NCP03WB473] = { "ncp03wb473", TYPE_NCPXXWB473 },
|
||||
[NTC_NCP03WF104] = { "ncp03wf104", TYPE_NCPXXWF104 },
|
||||
[NTC_NCP15WB473] = { "ncp15wb473", TYPE_NCPXXWB473 },
|
||||
[NTC_NCP15WL333] = { "ncp15wl333", TYPE_NCPXXWL333 },
|
||||
[NTC_NCP15XH103] = { "ncp15xh103", TYPE_NCPXXXH103 },
|
||||
[NTC_NCP18WB473] = { "ncp18wb473", TYPE_NCPXXWB473 },
|
||||
[NTC_NCP21WB473] = { "ncp21wb473", TYPE_NCPXXWB473 },
|
||||
[NTC_SSG1404001221] = { "ssg1404_001221", TYPE_NCPXXWB473 },
|
||||
[NTC_NCP18WM474] = { "ncp18wm474", TYPE_NCPXXWM474 },
|
||||
[NTC_LAST] = { },
|
||||
[NTC_B57330V2103] = { .name = "b57330v2103", .driver_data = TYPE_B57330V2103 },
|
||||
[NTC_B57891S0103] = { .name = "b57891s0103", .driver_data = TYPE_B57891S0103 },
|
||||
[NTC_NCP03WB473] = { .name = "ncp03wb473", .driver_data = TYPE_NCPXXWB473 },
|
||||
[NTC_NCP03WF104] = { .name = "ncp03wf104", .driver_data = TYPE_NCPXXWF104 },
|
||||
[NTC_NCP15WB473] = { .name = "ncp15wb473", .driver_data = TYPE_NCPXXWB473 },
|
||||
[NTC_NCP15WL333] = { .name = "ncp15wl333", .driver_data = TYPE_NCPXXWL333 },
|
||||
[NTC_NCP15XH103] = { .name = "ncp15xh103", .driver_data = TYPE_NCPXXXH103 },
|
||||
[NTC_NCP18WB473] = { .name = "ncp18wb473", .driver_data = TYPE_NCPXXWB473 },
|
||||
[NTC_NCP21WB473] = { .name = "ncp21wb473", .driver_data = TYPE_NCPXXWB473 },
|
||||
[NTC_SSG1404001221] = { .name = "ssg1404_001221", .driver_data = TYPE_NCPXXWB473 },
|
||||
[NTC_NCP18WM474] = { .name = "ncp18wm474", .driver_data = TYPE_NCPXXWM474 },
|
||||
[NTC_LAST] = { }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(platform, ntc_thermistor_id);
|
||||
|
||||
|
||||
@@ -1036,11 +1036,11 @@ static void sht15_remove(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
static const struct platform_device_id sht15_device_ids[] = {
|
||||
{ "sht10", sht10 },
|
||||
{ "sht11", sht11 },
|
||||
{ "sht15", sht15 },
|
||||
{ "sht71", sht71 },
|
||||
{ "sht75", sht75 },
|
||||
{ .name = "sht10", .driver_data = sht10 },
|
||||
{ .name = "sht11", .driver_data = sht11 },
|
||||
{ .name = "sht15", .driver_data = sht15 },
|
||||
{ .name = "sht71", .driver_data = sht71 },
|
||||
{ .name = "sht75", .driver_data = sht75 },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(platform, sht15_device_ids);
|
||||
|
||||
Reference in New Issue
Block a user