Skip to content

Commit 3686272

Browse files
ukleinekjic23
authored andcommitted
iio: 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. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent 3dd0c04 commit 3686272

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/iio/adc/88pm886-gpadc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ static DEFINE_RUNTIME_DEV_PM_OPS(pm886_gpadc_pm_ops,
373373
pm886_gpadc_runtime_resume, NULL);
374374

375375
static const struct platform_device_id pm886_gpadc_id[] = {
376-
{ "88pm886-gpadc" },
376+
{ .name = "88pm886-gpadc" },
377377
{ }
378378
};
379379
MODULE_DEVICE_TABLE(platform, pm886_gpadc_id);

drivers/iio/adc/max77541-adc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int max77541_adc_probe(struct platform_device *pdev)
175175
}
176176

177177
static const struct platform_device_id max77541_adc_platform_id[] = {
178-
{ "max77541-adc" },
178+
{ .name = "max77541-adc" },
179179
{ }
180180
};
181181
MODULE_DEVICE_TABLE(platform, max77541_adc_platform_id);

drivers/iio/adc/sun4i-gpadc-iio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -679,9 +679,9 @@ static void sun4i_gpadc_remove(struct platform_device *pdev)
679679
}
680680

681681
static const struct platform_device_id sun4i_gpadc_id[] = {
682-
{ "sun4i-a10-gpadc-iio", (kernel_ulong_t)&sun4i_gpadc_data },
683-
{ "sun5i-a13-gpadc-iio", (kernel_ulong_t)&sun5i_gpadc_data },
684-
{ "sun6i-a31-gpadc-iio", (kernel_ulong_t)&sun6i_gpadc_data },
682+
{ .name = "sun4i-a10-gpadc-iio", .driver_data = (kernel_ulong_t)&sun4i_gpadc_data },
683+
{ .name = "sun5i-a13-gpadc-iio", .driver_data = (kernel_ulong_t)&sun5i_gpadc_data },
684+
{ .name = "sun6i-a31-gpadc-iio", .driver_data = (kernel_ulong_t)&sun6i_gpadc_data },
685685
{ }
686686
};
687687
MODULE_DEVICE_TABLE(platform, sun4i_gpadc_id);

0 commit comments

Comments
 (0)