diff options
| author | Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> | 2026-05-27 18:15:53 +0300 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2026-06-09 18:23:17 +0300 |
| commit | d12bcf7d414065e0708e775b93e445fcfe423751 (patch) | |
| tree | 892f9d618a9ca272d4c52f59f7292b8b2a70a406 | |
| parent | acac4eb97a8e50bc5589fc948e2c2a7ded8f8e86 (diff) | |
| download | linux-d12bcf7d414065e0708e775b93e445fcfe423751.tar.xz | |
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>
| -rw-r--r-- | drivers/hwmon/max197.c | 4 | ||||
| -rw-r--r-- | drivers/hwmon/ntc_thermistor.c | 24 | ||||
| -rw-r--r-- | drivers/hwmon/sht15.c | 10 |
3 files changed, 19 insertions, 19 deletions
diff --git a/drivers/hwmon/max197.c b/drivers/hwmon/max197.c index f0048ff37607..9b6ab050db1b 100644 --- a/drivers/hwmon/max197.c +++ b/drivers/hwmon/max197.c @@ -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); diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c index d6b48178343d..6f82a6c49393 100644 --- a/drivers/hwmon/ntc_thermistor.c +++ b/drivers/hwmon/ntc_thermistor.c @@ -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); diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c index 3d55047e9baf..101cebbe68e4 100644 --- a/drivers/hwmon/sht15.c +++ b/drivers/hwmon/sht15.c @@ -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); |
