[PATCH 07/12] iio: light: use named initializers for acpi_device_id
From: Pawel Zalewski
Date: Mon Oct 05 2026 - 10:07:15 EST
Use a designated initializer for the acpi_device_id fields which makes the
code more readable and consistent with how lists are initialized in the
rest of the kernel code base. Also drop explicitly setting fields to 0
where it is redundant.
Signed-off-by: Pawel Zalewski <pzalewski@xxxxxxxxxxxxxxxxxxxx>
---
drivers/iio/light/acpi-als.c | 2 +-
drivers/iio/light/al3320a.c | 2 +-
drivers/iio/light/apds9960.c | 2 +-
drivers/iio/light/cm32181.c | 2 +-
drivers/iio/light/isl29018.c | 6 +++---
drivers/iio/light/jsa1212.c | 2 +-
drivers/iio/light/ltr501.c | 4 ++--
drivers/iio/light/max44000.c | 2 +-
drivers/iio/light/pa12203001.c | 2 +-
drivers/iio/light/rpr0521.c | 2 +-
drivers/iio/light/stk3310.c | 6 +++---
drivers/iio/light/us5182d.c | 2 +-
12 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/iio/light/acpi-als.c b/drivers/iio/light/acpi-als.c
index 1983a7f17aa9..9faaffb94b8f 100644
--- a/drivers/iio/light/acpi-als.c
+++ b/drivers/iio/light/acpi-als.c
@@ -238,7 +238,7 @@ static void acpi_als_remove(struct platform_device *pdev)
}
static const struct acpi_device_id acpi_als_device_ids[] = {
- {"ACPI0008", 0},
+ { .id = "ACPI0008" },
{ }
};
diff --git a/drivers/iio/light/al3320a.c b/drivers/iio/light/al3320a.c
index 8bb7f7e878c2..1610a09ee204 100644
--- a/drivers/iio/light/al3320a.c
+++ b/drivers/iio/light/al3320a.c
@@ -259,7 +259,7 @@ static const struct of_device_id al3320a_of_match[] = {
MODULE_DEVICE_TABLE(of, al3320a_of_match);
static const struct acpi_device_id al3320a_acpi_match[] = {
- {"CALS0001"},
+ { .id = "CALS0001" },
{ }
};
MODULE_DEVICE_TABLE(acpi, al3320a_acpi_match);
diff --git a/drivers/iio/light/apds9960.c b/drivers/iio/light/apds9960.c
index afe520de60e2..996ab9a9ee27 100644
--- a/drivers/iio/light/apds9960.c
+++ b/drivers/iio/light/apds9960.c
@@ -1158,7 +1158,7 @@ static const struct i2c_device_id apds9960_id[] = {
MODULE_DEVICE_TABLE(i2c, apds9960_id);
static const struct acpi_device_id apds9960_acpi_match[] = {
- { "MSHW0184" },
+ { .id = "MSHW0184" },
{ }
};
MODULE_DEVICE_TABLE(acpi, apds9960_acpi_match);
diff --git a/drivers/iio/light/cm32181.c b/drivers/iio/light/cm32181.c
index b32a94028f09..8b376e5a9f08 100644
--- a/drivers/iio/light/cm32181.c
+++ b/drivers/iio/light/cm32181.c
@@ -527,7 +527,7 @@ MODULE_DEVICE_TABLE(of, cm32181_of_match);
#ifdef CONFIG_ACPI
static const struct acpi_device_id cm32181_acpi_match[] = {
- { "CPLM3218", 0 },
+ { .id = "CPLM3218" },
{ }
};
MODULE_DEVICE_TABLE(acpi, cm32181_acpi_match);
diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c
index 759cb71ed1c5..3463da0f7a98 100644
--- a/drivers/iio/light/isl29018.c
+++ b/drivers/iio/light/isl29018.c
@@ -820,9 +820,9 @@ static DEFINE_SIMPLE_DEV_PM_OPS(isl29018_pm_ops, isl29018_suspend,
isl29018_resume);
static const struct acpi_device_id isl29018_acpi_match[] = {
- {"ISL29018", isl29018},
- {"ISL29023", isl29023},
- {"ISL29035", isl29035},
+ { .id = "ISL29018", .driver_data = isl29018 },
+ { .id = "ISL29023", .driver_data = isl29023 },
+ { .id = "ISL29035", .driver_data = isl29035 },
{ }
};
MODULE_DEVICE_TABLE(acpi, isl29018_acpi_match);
diff --git a/drivers/iio/light/jsa1212.c b/drivers/iio/light/jsa1212.c
index 038ee49723ae..8a08cc468872 100644
--- a/drivers/iio/light/jsa1212.c
+++ b/drivers/iio/light/jsa1212.c
@@ -421,7 +421,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(jsa1212_pm_ops, jsa1212_suspend,
jsa1212_resume);
static const struct acpi_device_id jsa1212_acpi_match[] = {
- {"JSA1212", 0},
+ { .id = "JSA1212" },
{ }
};
MODULE_DEVICE_TABLE(acpi, jsa1212_acpi_match);
diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
index fa0d16890c8b..5d2d020ddbc0 100644
--- a/drivers/iio/light/ltr501.c
+++ b/drivers/iio/light/ltr501.c
@@ -1589,9 +1589,9 @@ static int ltr501_resume(struct device *dev)
static DEFINE_SIMPLE_DEV_PM_OPS(ltr501_pm_ops, ltr501_suspend, ltr501_resume);
static const struct acpi_device_id ltr_acpi_match[] = {
- { "LTER0301", ltr301 },
+ { .id = "LTER0301", .driver_data = ltr301 },
/* https://www.catalog.update.microsoft.com/Search.aspx?q=lter0303 */
- { "LTER0303", ltr303 },
+ { .id = "LTER0303", .driver_data = ltr303 },
{ }
};
MODULE_DEVICE_TABLE(acpi, ltr_acpi_match);
diff --git a/drivers/iio/light/max44000.c b/drivers/iio/light/max44000.c
index 8c344f1b3fe2..2d25bdcfe5ae 100644
--- a/drivers/iio/light/max44000.c
+++ b/drivers/iio/light/max44000.c
@@ -603,7 +603,7 @@ static const struct i2c_device_id max44000_id[] = {
MODULE_DEVICE_TABLE(i2c, max44000_id);
static const struct acpi_device_id max44000_acpi_match[] = {
- {"MAX44000", 0},
+ { .id = "MAX44000" },
{ }
};
MODULE_DEVICE_TABLE(acpi, max44000_acpi_match);
diff --git a/drivers/iio/light/pa12203001.c b/drivers/iio/light/pa12203001.c
index c0f4db8d95f7..657ba24def38 100644
--- a/drivers/iio/light/pa12203001.c
+++ b/drivers/iio/light/pa12203001.c
@@ -450,7 +450,7 @@ static const struct dev_pm_ops pa12203001_pm_ops = {
};
static const struct acpi_device_id pa12203001_acpi_match[] = {
- { "TXCPA122", 0 },
+ { .id = "TXCPA122" },
{ }
};
diff --git a/drivers/iio/light/rpr0521.c b/drivers/iio/light/rpr0521.c
index 7d82efc31f3a..b429c7b8b0fb 100644
--- a/drivers/iio/light/rpr0521.c
+++ b/drivers/iio/light/rpr0521.c
@@ -1095,7 +1095,7 @@ static const struct dev_pm_ops rpr0521_pm_ops = {
};
static const struct acpi_device_id rpr0521_acpi_match[] = {
- {"RPR0521", 0},
+ { .id = "RPR0521" },
{ }
};
MODULE_DEVICE_TABLE(acpi, rpr0521_acpi_match);
diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
index 7c8a1d2b2ed0..37ae90c84779 100644
--- a/drivers/iio/light/stk3310.c
+++ b/drivers/iio/light/stk3310.c
@@ -775,9 +775,9 @@ static const struct i2c_device_id stk3310_i2c_id[] = {
MODULE_DEVICE_TABLE(i2c, stk3310_i2c_id);
static const struct acpi_device_id stk3310_acpi_id[] = {
- {"STK3013", 0},
- {"STK3310", 0},
- {"STK3311", 0},
+ { .id = "STK3013" },
+ { .id = "STK3310" },
+ { .id = "STK3311" },
{ }
};
diff --git a/drivers/iio/light/us5182d.c b/drivers/iio/light/us5182d.c
index ab518311fd79..5d05c751e13f 100644
--- a/drivers/iio/light/us5182d.c
+++ b/drivers/iio/light/us5182d.c
@@ -941,7 +941,7 @@ static const struct dev_pm_ops us5182d_pm_ops = {
};
static const struct acpi_device_id us5182d_acpi_match[] = {
- { "USD5182", 0 },
+ { .id = "USD5182" },
{ }
};
--
2.53.0