]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iio: Use named initializers for platform_device_id arrays
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Thu, 28 May 2026 10:16:49 +0000 (12:16 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2026 10:01:51 +0000 (11:01 +0100)
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>
drivers/iio/adc/88pm886-gpadc.c
drivers/iio/adc/max77541-adc.c
drivers/iio/adc/sun4i-gpadc-iio.c

index cffe35136685e1814b5b74d1c6fcfe743125b82c..4435f3d5e2b888cfc119b08dafb230712cecd566 100644 (file)
@@ -373,7 +373,7 @@ static DEFINE_RUNTIME_DEV_PM_OPS(pm886_gpadc_pm_ops,
                                 pm886_gpadc_runtime_resume, NULL);
 
 static const struct platform_device_id pm886_gpadc_id[] = {
-       { "88pm886-gpadc" },
+       { .name = "88pm886-gpadc" },
        { }
 };
 MODULE_DEVICE_TABLE(platform, pm886_gpadc_id);
index 0aa04d143ad4cc3a46cb28924f7652851bbbb449..013da014bccdfec224207ce27d9ef2eff27718c8 100644 (file)
@@ -175,7 +175,7 @@ static int max77541_adc_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id max77541_adc_platform_id[] = {
-       { "max77541-adc" },
+       { .name = "max77541-adc" },
        { }
 };
 MODULE_DEVICE_TABLE(platform, max77541_adc_platform_id);
index 479115ea50bf9316d88015e68577e44e9fc5c897..203459ca99079ff48b1830d941e2ee4205ac94be 100644 (file)
@@ -679,9 +679,9 @@ static void sun4i_gpadc_remove(struct platform_device *pdev)
 }
 
 static const struct platform_device_id sun4i_gpadc_id[] = {
-       { "sun4i-a10-gpadc-iio", (kernel_ulong_t)&sun4i_gpadc_data },
-       { "sun5i-a13-gpadc-iio", (kernel_ulong_t)&sun5i_gpadc_data },
-       { "sun6i-a31-gpadc-iio", (kernel_ulong_t)&sun6i_gpadc_data },
+       { .name = "sun4i-a10-gpadc-iio", .driver_data = (kernel_ulong_t)&sun4i_gpadc_data },
+       { .name = "sun5i-a13-gpadc-iio", .driver_data = (kernel_ulong_t)&sun5i_gpadc_data },
+       { .name = "sun6i-a31-gpadc-iio", .driver_data = (kernel_ulong_t)&sun6i_gpadc_data },
        { }
 };
 MODULE_DEVICE_TABLE(platform, sun4i_gpadc_id);