* [PATCH 01/12] iio: accel: use named initializers for acpi_device_id
2026-10-05 14:01 [PATCH 00/12] iio: use designated initializers for acpi_device_id Pawel Zalewski
@ 2026-10-05 14:01 ` Pawel Zalewski
2026-10-05 14:01 ` [PATCH 02/12] iio: adc: " Pawel Zalewski
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Pawel Zalewski @ 2026-10-05 14:01 UTC (permalink / raw)
To: Nuno Sá,
Michael Hennerich, Jonathan Cameron, David Lechner,
Andy Shevchenko, Petre Rodan, Matteo Martelli, Marius Cristea,
Matti Vaittinen, Lorenzo Bianconi, Alex Lanzano, Jagath Jog J,
Jean-Baptiste Maneyrol, Kevin Tsai, Eddie James, Marcelo Schmitt
Cc: linux, linux-iio, linux-kernel, Pawel Zalewski
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@thegoodpenguin.co.uk>
---
drivers/iio/accel/adxl345_i2c.c | 2 +-
drivers/iio/accel/adxl345_spi.c | 2 +-
drivers/iio/accel/bma220_spi.c | 2 +-
drivers/iio/accel/bmc150-accel-i2c.c | 24 ++++++++++++------------
drivers/iio/accel/bmc150-accel-spi.c | 16 ++++++++--------
drivers/iio/accel/da280.c | 4 ++--
drivers/iio/accel/kxcjk-1013.c | 22 +++++++++++-----------
drivers/iio/accel/mma7660.c | 2 +-
drivers/iio/accel/mma9551.c | 2 +-
drivers/iio/accel/mma9553.c | 2 +-
drivers/iio/accel/mxc4005.c | 6 +++---
drivers/iio/accel/mxc6255.c | 4 ++--
drivers/iio/accel/st_accel_i2c.c | 4 ++--
drivers/iio/accel/stk8ba50.c | 2 +-
14 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/drivers/iio/accel/adxl345_i2c.c b/drivers/iio/accel/adxl345_i2c.c
index 511fb610436c..609b5d881097 100644
--- a/drivers/iio/accel/adxl345_i2c.c
+++ b/drivers/iio/accel/adxl345_i2c.c
@@ -57,7 +57,7 @@ static const struct of_device_id adxl345_of_match[] = {
MODULE_DEVICE_TABLE(of, adxl345_of_match);
static const struct acpi_device_id adxl345_acpi_match[] = {
- { "ADS0345", (kernel_ulong_t)&adxl345_i2c_info },
+ { .id = "ADS0345", .driver_data = (kernel_ulong_t)&adxl345_i2c_info },
{ }
};
MODULE_DEVICE_TABLE(acpi, adxl345_acpi_match);
diff --git a/drivers/iio/accel/adxl345_spi.c b/drivers/iio/accel/adxl345_spi.c
index 4fa1b04f75b6..e916ca9cc854 100644
--- a/drivers/iio/accel/adxl345_spi.c
+++ b/drivers/iio/accel/adxl345_spi.c
@@ -74,7 +74,7 @@ static const struct of_device_id adxl345_of_match[] = {
MODULE_DEVICE_TABLE(of, adxl345_of_match);
static const struct acpi_device_id adxl345_acpi_match[] = {
- { "ADS0345", (kernel_ulong_t)&adxl345_spi_info },
+ { .id = "ADS0345", .driver_data = (kernel_ulong_t)&adxl345_spi_info },
{ }
};
MODULE_DEVICE_TABLE(acpi, adxl345_acpi_match);
diff --git a/drivers/iio/accel/bma220_spi.c b/drivers/iio/accel/bma220_spi.c
index d6c1087cc3c0..5c4de5af69ac 100644
--- a/drivers/iio/accel/bma220_spi.c
+++ b/drivers/iio/accel/bma220_spi.c
@@ -30,7 +30,7 @@ static const struct spi_device_id bma220_spi_id[] = {
};
static const struct acpi_device_id bma220_acpi_id[] = {
- { "BMA0220", 0 },
+ { .id = "BMA0220" },
{ }
};
MODULE_DEVICE_TABLE(spi, bma220_spi_id);
diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c
index 336866aad20c..4041825c068d 100644
--- a/drivers/iio/accel/bmc150-accel-i2c.c
+++ b/drivers/iio/accel/bmc150-accel-i2c.c
@@ -14,8 +14,8 @@
#ifdef CONFIG_ACPI
static const struct acpi_device_id bmc150_acpi_dual_accel_ids[] = {
- {"BOSC0200"},
- {"DUAL250E"},
+ { .id = "BOSC0200" },
+ { .id = "DUAL250E" },
{ }
};
@@ -216,13 +216,13 @@ static void bmc150_accel_remove(struct i2c_client *client)
}
static const struct acpi_device_id bmc150_accel_acpi_match[] = {
- {"BMA0255"},
- {"BMA0280"},
- {"BMA222"},
- {"BMA222E"},
- {"BMA250E"},
- {"BMC150A"},
- {"BMI055A"},
+ { .id = "BMA0255" },
+ { .id = "BMA0280" },
+ { .id = "BMA222" },
+ { .id = "BMA222E" },
+ { .id = "BMA250E" },
+ { .id = "BMC150A" },
+ { .id = "BMI055A" },
/*
* The "BOSC0200" identifier used here is not unique to devices using
* bmc150. The same "BOSC0200" identifier is found in the ACPI tables
@@ -236,9 +236,9 @@ static const struct acpi_device_id bmc150_accel_acpi_match[] = {
* seen. This allows the bmi323 driver to take over for ASUS ROG ALLY,
* and other devices using the bmi323 chip.
*/
- {"BOSC0200"},
- {"BSBA0150"},
- {"DUAL250E"},
+ { .id = "BOSC0200" },
+ { .id = "BSBA0150" },
+ { .id = "DUAL250E" },
{ }
};
MODULE_DEVICE_TABLE(acpi, bmc150_accel_acpi_match);
diff --git a/drivers/iio/accel/bmc150-accel-spi.c b/drivers/iio/accel/bmc150-accel-spi.c
index 405bd7b2d199..8014d8caa4a4 100644
--- a/drivers/iio/accel/bmc150-accel-spi.c
+++ b/drivers/iio/accel/bmc150-accel-spi.c
@@ -39,14 +39,14 @@ static void bmc150_accel_remove(struct spi_device *spi)
}
static const struct acpi_device_id bmc150_accel_acpi_match[] = {
- {"BMA0255"},
- {"BMA0280"},
- {"BMA222"},
- {"BMA222E"},
- {"BMA250E"},
- {"BMC150A"},
- {"BMI055A"},
- {"BSBA0150"},
+ { .id = "BMA0255" },
+ { .id = "BMA0280" },
+ { .id = "BMA222" },
+ { .id = "BMA222E" },
+ { .id = "BMA250E" },
+ { .id = "BMC150A" },
+ { .id = "BMI055A" },
+ { .id = "BSBA0150" },
{ }
};
MODULE_DEVICE_TABLE(acpi, bmc150_accel_acpi_match);
diff --git a/drivers/iio/accel/da280.c b/drivers/iio/accel/da280.c
index 15acbe1c2cbd..d5ad981cfbc0 100644
--- a/drivers/iio/accel/da280.c
+++ b/drivers/iio/accel/da280.c
@@ -155,8 +155,8 @@ static const struct da280_match_data da226_match_data = { "da226", 2 };
static const struct da280_match_data da280_match_data = { "da280", 3 };
static const struct acpi_device_id da280_acpi_match[] = {
- { "NSA2513", (kernel_ulong_t)&da217_match_data },
- { "MIRAACC", (kernel_ulong_t)&da280_match_data },
+ { .id = "NSA2513", .driver_data = (kernel_ulong_t)&da217_match_data },
+ { .id = "MIRAACC", .driver_data = (kernel_ulong_t)&da280_match_data },
{ }
};
MODULE_DEVICE_TABLE(acpi, da280_acpi_match);
diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
index 8994c9e8e048..73d23d36cc11 100644
--- a/drivers/iio/accel/kxcjk-1013.c
+++ b/drivers/iio/accel/kxcjk-1013.c
@@ -1649,19 +1649,19 @@ static const struct of_device_id kxcjk1013_of_match[] = {
MODULE_DEVICE_TABLE(of, kxcjk1013_of_match);
static const struct acpi_device_id kx_acpi_match[] = {
- { "KIOX0008", (kernel_ulong_t)&kxcj91008_info },
- { "KIOX0009", (kernel_ulong_t)&kxtj21009_info },
- { "KIOX000A", (kernel_ulong_t)&kxcj91008_info },
+ { .id = "KIOX0008", .driver_data = (kernel_ulong_t)&kxcj91008_info },
+ { .id = "KIOX0009", .driver_data = (kernel_ulong_t)&kxtj21009_info },
+ { .id = "KIOX000A", .driver_data = (kernel_ulong_t)&kxcj91008_info },
/* KXCJ91008 in the display of a yoga 2-in-1 */
- { "KIOX010A", (kernel_ulong_t)&kxcj91008_kiox010a_info },
+ { .id = "KIOX010A", .driver_data = (kernel_ulong_t)&kxcj91008_kiox010a_info },
/* KXCJ91008 in the base of a yoga 2-in-1 */
- { "KIOX020A", (kernel_ulong_t)&kxcj91008_kiox020a_info },
- { "KXCJ1008", (kernel_ulong_t)&kxcj91008_info },
- { "KXCJ1013", (kernel_ulong_t)&kxcjk1013_info },
- { "KXCJ9000", (kernel_ulong_t)&kxcj91008_info },
- { "KXJ2109", (kernel_ulong_t)&kxtj21009_info },
- { "KXTJ1009", (kernel_ulong_t)&kxtj21009_info },
- { "SMO8500", (kernel_ulong_t)&kxcj91008_smo8500_info },
+ { .id = "KIOX020A", .driver_data = (kernel_ulong_t)&kxcj91008_kiox020a_info },
+ { .id = "KXCJ1008", .driver_data = (kernel_ulong_t)&kxcj91008_info },
+ { .id = "KXCJ1013", .driver_data = (kernel_ulong_t)&kxcjk1013_info },
+ { .id = "KXCJ9000", .driver_data = (kernel_ulong_t)&kxcj91008_info },
+ { .id = "KXJ2109", .driver_data = (kernel_ulong_t)&kxtj21009_info },
+ { .id = "KXTJ1009", .driver_data = (kernel_ulong_t)&kxtj21009_info },
+ { .id = "SMO8500", .driver_data = (kernel_ulong_t)&kxcj91008_smo8500_info },
{ }
};
MODULE_DEVICE_TABLE(acpi, kx_acpi_match);
diff --git a/drivers/iio/accel/mma7660.c b/drivers/iio/accel/mma7660.c
index 38b4df76cff3..1ad7b2206e33 100644
--- a/drivers/iio/accel/mma7660.c
+++ b/drivers/iio/accel/mma7660.c
@@ -270,7 +270,7 @@ static const struct of_device_id mma7660_of_match[] = {
MODULE_DEVICE_TABLE(of, mma7660_of_match);
static const struct acpi_device_id mma7660_acpi_id[] = {
- {"MMA7660", 0},
+ { .id = "MMA7660" },
{ }
};
diff --git a/drivers/iio/accel/mma9551.c b/drivers/iio/accel/mma9551.c
index 7e01427fd9c4..bb74dfa538b8 100644
--- a/drivers/iio/accel/mma9551.c
+++ b/drivers/iio/accel/mma9551.c
@@ -572,7 +572,7 @@ static const struct dev_pm_ops mma9551_pm_ops = {
};
static const struct acpi_device_id mma9551_acpi_match[] = {
- {"MMA9551", 0},
+ { .id = "MMA9551" },
{ }
};
diff --git a/drivers/iio/accel/mma9553.c b/drivers/iio/accel/mma9553.c
index 8e7aaac89d47..202aa91518b5 100644
--- a/drivers/iio/accel/mma9553.c
+++ b/drivers/iio/accel/mma9553.c
@@ -1208,7 +1208,7 @@ static const struct dev_pm_ops mma9553_pm_ops = {
};
static const struct acpi_device_id mma9553_acpi_match[] = {
- {"MMA9553", 0},
+ { .id = "MMA9553" },
{ }
};
diff --git a/drivers/iio/accel/mxc4005.c b/drivers/iio/accel/mxc4005.c
index a66fee828ec1..1559888e0995 100644
--- a/drivers/iio/accel/mxc4005.c
+++ b/drivers/iio/accel/mxc4005.c
@@ -561,9 +561,9 @@ static int mxc4005_resume(struct device *dev)
static DEFINE_SIMPLE_DEV_PM_OPS(mxc4005_pm_ops, mxc4005_suspend, mxc4005_resume);
static const struct acpi_device_id mxc4005_acpi_match[] = {
- {"MXC4005", 0},
- {"MXC6655", 0},
- {"MDA6655", 0},
+ { .id = "MXC4005" },
+ { .id = "MXC6655" },
+ { .id = "MDA6655" },
{ }
};
MODULE_DEVICE_TABLE(acpi, mxc4005_acpi_match);
diff --git a/drivers/iio/accel/mxc6255.c b/drivers/iio/accel/mxc6255.c
index a9f41cf27ad9..7b4d63a8bde1 100644
--- a/drivers/iio/accel/mxc6255.c
+++ b/drivers/iio/accel/mxc6255.c
@@ -163,8 +163,8 @@ static int mxc6255_probe(struct i2c_client *client)
}
static const struct acpi_device_id mxc6255_acpi_match[] = {
- {"MXC6225", 0},
- {"MXC6255", 0},
+ { .id = "MXC6225" },
+ { .id = "MXC6255" },
{ }
};
MODULE_DEVICE_TABLE(acpi, mxc6255_acpi_match);
diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c
index 99522a885d71..6d4b7d46869d 100644
--- a/drivers/iio/accel/st_accel_i2c.c
+++ b/drivers/iio/accel/st_accel_i2c.c
@@ -130,8 +130,8 @@ static const struct of_device_id st_accel_of_match[] = {
MODULE_DEVICE_TABLE(of, st_accel_of_match);
static const struct acpi_device_id st_accel_acpi_match[] = {
- {"SMO8840", (kernel_ulong_t)LIS2DH12_ACCEL_DEV_NAME},
- {"SMO8A90", (kernel_ulong_t)LNG2DM_ACCEL_DEV_NAME},
+ { .id = "SMO8840", .driver_data = (kernel_ulong_t)LIS2DH12_ACCEL_DEV_NAME },
+ { .id = "SMO8A90", .driver_data = (kernel_ulong_t)LNG2DM_ACCEL_DEV_NAME },
{ }
};
MODULE_DEVICE_TABLE(acpi, st_accel_acpi_match);
diff --git a/drivers/iio/accel/stk8ba50.c b/drivers/iio/accel/stk8ba50.c
index 6c1e286c0a1d..2ae9a97524cc 100644
--- a/drivers/iio/accel/stk8ba50.c
+++ b/drivers/iio/accel/stk8ba50.c
@@ -528,7 +528,7 @@ static const struct i2c_device_id stk8ba50_i2c_id[] = {
MODULE_DEVICE_TABLE(i2c, stk8ba50_i2c_id);
static const struct acpi_device_id stk8ba50_acpi_id[] = {
- {"STK8BA50", 0},
+ { .id = "STK8BA50" },
{ }
};
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 02/12] iio: adc: use named initializers for acpi_device_id
2026-10-05 14:01 [PATCH 00/12] iio: use designated initializers for acpi_device_id Pawel Zalewski
2026-10-05 14:01 ` [PATCH 01/12] iio: accel: use named " Pawel Zalewski
@ 2026-10-05 14:01 ` Pawel Zalewski
2026-10-05 14:01 ` [PATCH 03/12] iio: dac: " Pawel Zalewski
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Pawel Zalewski @ 2026-10-05 14:01 UTC (permalink / raw)
To: Nuno Sá,
Michael Hennerich, Jonathan Cameron, David Lechner,
Andy Shevchenko, Petre Rodan, Matteo Martelli, Marius Cristea,
Matti Vaittinen, Lorenzo Bianconi, Alex Lanzano, Jagath Jog J,
Jean-Baptiste Maneyrol, Kevin Tsai, Eddie James, Marcelo Schmitt
Cc: linux, linux-iio, linux-kernel, Pawel Zalewski
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@thegoodpenguin.co.uk>
---
drivers/iio/adc/ad7298.c | 2 +-
drivers/iio/adc/pac1921.c | 2 +-
drivers/iio/adc/pac1934.c | 2 +-
drivers/iio/adc/ti-adc081c.c | 2 +-
drivers/iio/adc/ti-adc108s102.c | 2 +-
drivers/iio/adc/ti-adc128s052.c | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/iio/adc/ad7298.c b/drivers/iio/adc/ad7298.c
index c669022b5dec..66b8ca4e3132 100644
--- a/drivers/iio/adc/ad7298.c
+++ b/drivers/iio/adc/ad7298.c
@@ -347,7 +347,7 @@ static int ad7298_probe(struct spi_device *spi)
}
static const struct acpi_device_id ad7298_acpi_ids[] = {
- { "INT3494", 0 },
+ { .id = "INT3494" },
{ }
};
MODULE_DEVICE_TABLE(acpi, ad7298_acpi_ids);
diff --git a/drivers/iio/adc/pac1921.c b/drivers/iio/adc/pac1921.c
index f0bab94462f4..730416ba147b 100644
--- a/drivers/iio/adc/pac1921.c
+++ b/drivers/iio/adc/pac1921.c
@@ -1322,7 +1322,7 @@ static const struct of_device_id pac1921_of_match[] = {
MODULE_DEVICE_TABLE(of, pac1921_of_match);
static const struct acpi_device_id pac1921_acpi_match[] = {
- { "MCHP1921" },
+ { .id = "MCHP1921" },
{ }
};
MODULE_DEVICE_TABLE(acpi, pac1921_acpi_match);
diff --git a/drivers/iio/adc/pac1934.c b/drivers/iio/adc/pac1934.c
index de59dc27c440..7e18a8728bd8 100644
--- a/drivers/iio/adc/pac1934.c
+++ b/drivers/iio/adc/pac1934.c
@@ -1612,7 +1612,7 @@ MODULE_DEVICE_TABLE(of, pac1934_of_match);
* https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ApplicationNotes/ApplicationNotes/PAC1934-Integration-Notes-for-Microsoft-Windows-10-and-Windows-11-Driver-Support-DS00002534.pdf
*/
static const struct acpi_device_id pac1934_acpi_match[] = {
- { "MCHP1930", .driver_data = (kernel_ulong_t)&pac1934_chip_config[PAC1934] },
+ { .id = "MCHP1930", .driver_data = (kernel_ulong_t)&pac1934_chip_config[PAC1934] },
{ }
};
MODULE_DEVICE_TABLE(acpi, pac1934_acpi_match);
diff --git a/drivers/iio/adc/ti-adc081c.c b/drivers/iio/adc/ti-adc081c.c
index 2df8f1c21c2a..d222c5637a71 100644
--- a/drivers/iio/adc/ti-adc081c.c
+++ b/drivers/iio/adc/ti-adc081c.c
@@ -205,7 +205,7 @@ MODULE_DEVICE_TABLE(i2c, adc081c_id);
static const struct acpi_device_id adc081c_acpi_match[] = {
/* Used on some AAEON boards */
- { "ADC081C", (kernel_ulong_t)&adc081c_model },
+ { .id = "ADC081C", .driver_data = (kernel_ulong_t)&adc081c_model },
{ }
};
MODULE_DEVICE_TABLE(acpi, adc081c_acpi_match);
diff --git a/drivers/iio/adc/ti-adc108s102.c b/drivers/iio/adc/ti-adc108s102.c
index 10959e835cb8..316d2eb16991 100644
--- a/drivers/iio/adc/ti-adc108s102.c
+++ b/drivers/iio/adc/ti-adc108s102.c
@@ -270,7 +270,7 @@ static const struct of_device_id adc108s102_of_match[] = {
MODULE_DEVICE_TABLE(of, adc108s102_of_match);
static const struct acpi_device_id adc108s102_acpi_ids[] = {
- { "INT3495", 0 },
+ { .id = "INT3495" },
{ }
};
MODULE_DEVICE_TABLE(acpi, adc108s102_acpi_ids);
diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c
index 1899813c1aee..381e2121a2b7 100644
--- a/drivers/iio/adc/ti-adc128s052.c
+++ b/drivers/iio/adc/ti-adc128s052.c
@@ -264,7 +264,7 @@ static const struct spi_device_id adc128_id[] = {
MODULE_DEVICE_TABLE(spi, adc128_id);
static const struct acpi_device_id adc128_acpi_match[] = {
- { "AANT1280", (kernel_ulong_t)&adc124s_config },
+ { .id = "AANT1280", .driver_data = (kernel_ulong_t)&adc124s_config },
{ }
};
MODULE_DEVICE_TABLE(acpi, adc128_acpi_match);
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 03/12] iio: dac: use named initializers for acpi_device_id
2026-10-05 14:01 [PATCH 00/12] iio: use designated initializers for acpi_device_id Pawel Zalewski
2026-10-05 14:01 ` [PATCH 01/12] iio: accel: use named " Pawel Zalewski
2026-10-05 14:01 ` [PATCH 02/12] iio: adc: " Pawel Zalewski
@ 2026-10-05 14:01 ` Pawel Zalewski
2026-10-05 14:02 ` [PATCH 04/12] iio: gyro: bmg160_i2c: " Pawel Zalewski
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Pawel Zalewski @ 2026-10-05 14:01 UTC (permalink / raw)
To: Nuno Sá,
Michael Hennerich, Jonathan Cameron, David Lechner,
Andy Shevchenko, Petre Rodan, Matteo Martelli, Marius Cristea,
Matti Vaittinen, Lorenzo Bianconi, Alex Lanzano, Jagath Jog J,
Jean-Baptiste Maneyrol, Kevin Tsai, Eddie James, Marcelo Schmitt
Cc: linux, linux-iio, linux-kernel, Pawel Zalewski
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.
Signed-off-by: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
---
drivers/iio/dac/ad5592r.c | 2 +-
drivers/iio/dac/ad5593r.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/dac/ad5592r.c b/drivers/iio/dac/ad5592r.c
index 88197bc6a70b..3a71b23f85d6 100644
--- a/drivers/iio/dac/ad5592r.c
+++ b/drivers/iio/dac/ad5592r.c
@@ -147,7 +147,7 @@ static const struct of_device_id ad5592r_of_match[] = {
MODULE_DEVICE_TABLE(of, ad5592r_of_match);
static const struct acpi_device_id ad5592r_acpi_match[] = {
- {"ADS5592", },
+ { .id = "ADS5592" },
{ }
};
MODULE_DEVICE_TABLE(acpi, ad5592r_acpi_match);
diff --git a/drivers/iio/dac/ad5593r.c b/drivers/iio/dac/ad5593r.c
index 3e4215f0ca7e..520170c44c51 100644
--- a/drivers/iio/dac/ad5593r.c
+++ b/drivers/iio/dac/ad5593r.c
@@ -126,7 +126,7 @@ static const struct of_device_id ad5593r_of_match[] = {
MODULE_DEVICE_TABLE(of, ad5593r_of_match);
static const struct acpi_device_id ad5593r_acpi_match[] = {
- {"ADS5593", },
+ { .id = "ADS5593" },
{ }
};
MODULE_DEVICE_TABLE(acpi, ad5593r_acpi_match);
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 04/12] iio: gyro: bmg160_i2c: use named initializers for acpi_device_id
2026-10-05 14:01 [PATCH 00/12] iio: use designated initializers for acpi_device_id Pawel Zalewski
` (2 preceding siblings ...)
2026-10-05 14:01 ` [PATCH 03/12] iio: dac: " Pawel Zalewski
@ 2026-10-05 14:02 ` Pawel Zalewski
2026-10-05 14:02 ` [PATCH 05/12] iio: humidity: " Pawel Zalewski
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Pawel Zalewski @ 2026-10-05 14:02 UTC (permalink / raw)
To: Nuno Sá,
Michael Hennerich, Jonathan Cameron, David Lechner,
Andy Shevchenko, Petre Rodan, Matteo Martelli, Marius Cristea,
Matti Vaittinen, Lorenzo Bianconi, Alex Lanzano, Jagath Jog J,
Jean-Baptiste Maneyrol, Kevin Tsai, Eddie James, Marcelo Schmitt
Cc: linux, linux-iio, linux-kernel, Pawel Zalewski
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@thegoodpenguin.co.uk>
---
drivers/iio/gyro/bmg160_i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/gyro/bmg160_i2c.c b/drivers/iio/gyro/bmg160_i2c.c
index be3cfbd286aa..e4ebd0318494 100644
--- a/drivers/iio/gyro/bmg160_i2c.c
+++ b/drivers/iio/gyro/bmg160_i2c.c
@@ -39,7 +39,7 @@ static void bmg160_i2c_remove(struct i2c_client *client)
}
static const struct acpi_device_id bmg160_acpi_match[] = {
- {"BMG0160", 0},
+ { .id = "BMG0160" },
{ }
};
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 05/12] iio: humidity: use named initializers for acpi_device_id
2026-10-05 14:01 [PATCH 00/12] iio: use designated initializers for acpi_device_id Pawel Zalewski
` (3 preceding siblings ...)
2026-10-05 14:02 ` [PATCH 04/12] iio: gyro: bmg160_i2c: " Pawel Zalewski
@ 2026-10-05 14:02 ` Pawel Zalewski
2026-10-05 14:02 ` [PATCH 06/12] iio: imu: " Pawel Zalewski
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Pawel Zalewski @ 2026-10-05 14:02 UTC (permalink / raw)
To: Nuno Sá,
Michael Hennerich, Jonathan Cameron, David Lechner,
Andy Shevchenko, Petre Rodan, Matteo Martelli, Marius Cristea,
Matti Vaittinen, Lorenzo Bianconi, Alex Lanzano, Jagath Jog J,
Jean-Baptiste Maneyrol, Kevin Tsai, Eddie James, Marcelo Schmitt
Cc: linux, linux-iio, linux-kernel, Pawel Zalewski
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@thegoodpenguin.co.uk>
---
drivers/iio/humidity/hdc100x.c | 2 +-
drivers/iio/humidity/hts221_i2c.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/humidity/hdc100x.c b/drivers/iio/humidity/hdc100x.c
index bc452cc8fbcf..9f07101d37f7 100644
--- a/drivers/iio/humidity/hdc100x.c
+++ b/drivers/iio/humidity/hdc100x.c
@@ -400,7 +400,7 @@ static const struct of_device_id hdc100x_dt_ids[] = {
MODULE_DEVICE_TABLE(of, hdc100x_dt_ids);
static const struct acpi_device_id hdc100x_acpi_match[] = {
- { "TXNW1010" },
+ { .id = "TXNW1010" },
{ }
};
MODULE_DEVICE_TABLE(acpi, hdc100x_acpi_match);
diff --git a/drivers/iio/humidity/hts221_i2c.c b/drivers/iio/humidity/hts221_i2c.c
index 40276abc5d2e..23fc1d820abd 100644
--- a/drivers/iio/humidity/hts221_i2c.c
+++ b/drivers/iio/humidity/hts221_i2c.c
@@ -40,7 +40,7 @@ static int hts221_i2c_probe(struct i2c_client *client)
}
static const struct acpi_device_id hts221_acpi_match[] = {
- {"SMO9100", 0},
+ { .id = "SMO9100" },
{ }
};
MODULE_DEVICE_TABLE(acpi, hts221_acpi_match);
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 06/12] iio: imu: use named initializers for acpi_device_id
2026-10-05 14:01 [PATCH 00/12] iio: use designated initializers for acpi_device_id Pawel Zalewski
` (4 preceding siblings ...)
2026-10-05 14:02 ` [PATCH 05/12] iio: humidity: " Pawel Zalewski
@ 2026-10-05 14:02 ` Pawel Zalewski
2026-10-05 14:02 ` [PATCH 07/12] iio: light: " Pawel Zalewski
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Pawel Zalewski @ 2026-10-05 14:02 UTC (permalink / raw)
To: Nuno Sá,
Michael Hennerich, Jonathan Cameron, David Lechner,
Andy Shevchenko, Petre Rodan, Matteo Martelli, Marius Cristea,
Matti Vaittinen, Lorenzo Bianconi, Alex Lanzano, Jagath Jog J,
Jean-Baptiste Maneyrol, Kevin Tsai, Eddie James, Marcelo Schmitt
Cc: linux, linux-iio, linux-kernel, Pawel Zalewski
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@thegoodpenguin.co.uk>
---
drivers/iio/imu/bmi160/bmi160_i2c.c | 6 +++---
drivers/iio/imu/bmi160/bmi160_spi.c | 4 ++--
drivers/iio/imu/bmi270/bmi270_i2c.c | 4 ++--
drivers/iio/imu/bmi323/bmi323_i2c.c | 2 +-
drivers/iio/imu/fxos8700_i2c.c | 2 +-
drivers/iio/imu/fxos8700_spi.c | 2 +-
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 2 +-
drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 2 +-
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c | 4 ++--
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 2 +-
10 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/iio/imu/bmi160/bmi160_i2c.c b/drivers/iio/imu/bmi160/bmi160_i2c.c
index 3f3ee044a9cf..7a38f05a81fd 100644
--- a/drivers/iio/imu/bmi160/bmi160_i2c.c
+++ b/drivers/iio/imu/bmi160/bmi160_i2c.c
@@ -52,9 +52,9 @@ static const struct acpi_device_id bmi160_acpi_match[] = {
* this is not expected to change anymore since at least some of
* the affected devices are from 2021/2022.
*/
- {"10EC5280", 0},
- {"BMI0120", 0},
- {"BMI0160", 0},
+ { .id = "10EC5280" },
+ { .id = "BMI0120" },
+ { .id = "BMI0160" },
{ }
};
MODULE_DEVICE_TABLE(acpi, bmi160_acpi_match);
diff --git a/drivers/iio/imu/bmi160/bmi160_spi.c b/drivers/iio/imu/bmi160/bmi160_spi.c
index 107eb3374922..922909c8fa72 100644
--- a/drivers/iio/imu/bmi160/bmi160_spi.c
+++ b/drivers/iio/imu/bmi160/bmi160_spi.c
@@ -41,8 +41,8 @@ static const struct spi_device_id bmi160_spi_id[] = {
MODULE_DEVICE_TABLE(spi, bmi160_spi_id);
static const struct acpi_device_id bmi160_acpi_match[] = {
- {"BMI0120", 0},
- {"BMI0160", 0},
+ { .id = "BMI0120" },
+ { .id = "BMI0160" },
{ }
};
MODULE_DEVICE_TABLE(acpi, bmi160_acpi_match);
diff --git a/drivers/iio/imu/bmi270/bmi270_i2c.c b/drivers/iio/imu/bmi270/bmi270_i2c.c
index 7c035e82e6e9..1143c0061c81 100644
--- a/drivers/iio/imu/bmi270/bmi270_i2c.c
+++ b/drivers/iio/imu/bmi270/bmi270_i2c.c
@@ -40,9 +40,9 @@ MODULE_DEVICE_TABLE(i2c, bmi270_i2c_id);
static const struct acpi_device_id bmi270_acpi_match[] = {
/* GPD Win Mini, Aya Neo AIR Pro, OXP Mini Pro, etc. */
- { "BMI0160", (kernel_ulong_t)&bmi260_chip_info },
+ { .id = "BMI0160", .driver_data = (kernel_ulong_t)&bmi260_chip_info },
/* GPD Win Max 2 2023(sincice BIOS v0.40), etc. */
- { "BMI0260", (kernel_ulong_t)&bmi260_chip_info },
+ { .id = "BMI0260", .driver_data = (kernel_ulong_t)&bmi260_chip_info },
{ }
};
MODULE_DEVICE_TABLE(acpi, bmi270_acpi_match);
diff --git a/drivers/iio/imu/bmi323/bmi323_i2c.c b/drivers/iio/imu/bmi323/bmi323_i2c.c
index e835b91ea6b4..e025c88c30b4 100644
--- a/drivers/iio/imu/bmi323/bmi323_i2c.c
+++ b/drivers/iio/imu/bmi323/bmi323_i2c.c
@@ -107,7 +107,7 @@ static const struct acpi_device_id bmi323_acpi_match[] = {
* driver initialization. This device reset does occur in both the
* bmi323 and bmc150 init sequences.
*/
- { "BOSC0200" },
+ { .id = "BOSC0200" },
{ }
};
MODULE_DEVICE_TABLE(acpi, bmi323_acpi_match);
diff --git a/drivers/iio/imu/fxos8700_i2c.c b/drivers/iio/imu/fxos8700_i2c.c
index ba47e9260928..4441ddf01338 100644
--- a/drivers/iio/imu/fxos8700_i2c.c
+++ b/drivers/iio/imu/fxos8700_i2c.c
@@ -41,7 +41,7 @@ static const struct i2c_device_id fxos8700_i2c_id[] = {
MODULE_DEVICE_TABLE(i2c, fxos8700_i2c_id);
static const struct acpi_device_id fxos8700_acpi_match[] = {
- {"FXOS8700", 0},
+ { .id = "FXOS8700" },
{ }
};
MODULE_DEVICE_TABLE(acpi, fxos8700_acpi_match);
diff --git a/drivers/iio/imu/fxos8700_spi.c b/drivers/iio/imu/fxos8700_spi.c
index 56ad0c5914d9..2cd9cfcf867c 100644
--- a/drivers/iio/imu/fxos8700_spi.c
+++ b/drivers/iio/imu/fxos8700_spi.c
@@ -29,7 +29,7 @@ static const struct spi_device_id fxos8700_spi_id[] = {
MODULE_DEVICE_TABLE(spi, fxos8700_spi_id);
static const struct acpi_device_id fxos8700_acpi_match[] = {
- {"FXOS8700", 0},
+ { .id = "FXOS8700" },
{ }
};
MODULE_DEVICE_TABLE(acpi, fxos8700_acpi_match);
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
index 9ef6ab74af8b..8f00d6f04ac1 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
@@ -274,7 +274,7 @@ static const struct of_device_id inv_of_match[] = {
MODULE_DEVICE_TABLE(of, inv_of_match);
static const struct acpi_device_id inv_acpi_match[] = {
- {"INVN6500", INV_MPU6500},
+ { .id = "INVN6500", .driver_data = INV_MPU6500 },
{ }
};
MODULE_DEVICE_TABLE(acpi, inv_acpi_match);
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
index 71e90ddc19dd..c6ad2e150290 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
@@ -161,7 +161,7 @@ static const struct of_device_id inv_of_match[] = {
MODULE_DEVICE_TABLE(of, inv_of_match);
static const struct acpi_device_id inv_acpi_match[] = {
- {"INVN6000", INV_MPU6000},
+ { .id = "INVN6000", .driver_data = INV_MPU6000 },
{ }
};
MODULE_DEVICE_TABLE(acpi, inv_acpi_match);
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
index edec898cb11f..c4097ce2bf81 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
@@ -143,8 +143,8 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
static const struct acpi_device_id st_lsm6dsx_i2c_acpi_match[] = {
- { "SMO8B30", ST_LSM6DS3TRC_ID, },
- { "SMOCF00", ST_LSM6DSO_ID, },
+ { .id = "SMO8B30", .driver_data = ST_LSM6DS3TRC_ID },
+ { .id = "SMOCF00", .driver_data = ST_LSM6DSO_ID },
{ }
};
MODULE_DEVICE_TABLE(acpi, st_lsm6dsx_i2c_acpi_match);
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
index 6581d14e2bcf..a22ac4279503 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
@@ -39,7 +39,7 @@ static const struct i2c_device_id st_lsm9ds0_id_table[] = {
MODULE_DEVICE_TABLE(i2c, st_lsm9ds0_id_table);
static const struct acpi_device_id st_lsm9ds0_acpi_match[] = {
- {"ACCL0001", (kernel_ulong_t)LSM303D_IMU_DEV_NAME},
+ { .id = "ACCL0001", .driver_data = (kernel_ulong_t)LSM303D_IMU_DEV_NAME },
{ }
};
MODULE_DEVICE_TABLE(acpi, st_lsm9ds0_acpi_match);
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 07/12] iio: light: use named initializers for acpi_device_id
2026-10-05 14:01 [PATCH 00/12] iio: use designated initializers for acpi_device_id Pawel Zalewski
` (5 preceding siblings ...)
2026-10-05 14:02 ` [PATCH 06/12] iio: imu: " Pawel Zalewski
@ 2026-10-05 14:02 ` Pawel Zalewski
2026-10-05 14:02 ` [PATCH 08/12] iio: magnetometer: " Pawel Zalewski
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Pawel Zalewski @ 2026-10-05 14:02 UTC (permalink / raw)
To: Nuno Sá,
Michael Hennerich, Jonathan Cameron, David Lechner,
Andy Shevchenko, Petre Rodan, Matteo Martelli, Marius Cristea,
Matti Vaittinen, Lorenzo Bianconi, Alex Lanzano, Jagath Jog J,
Jean-Baptiste Maneyrol, Kevin Tsai, Eddie James, Marcelo Schmitt
Cc: linux, linux-iio, linux-kernel, Pawel Zalewski
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@thegoodpenguin.co.uk>
---
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
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 08/12] iio: magnetometer: use named initializers for acpi_device_id
2026-10-05 14:01 [PATCH 00/12] iio: use designated initializers for acpi_device_id Pawel Zalewski
` (6 preceding siblings ...)
2026-10-05 14:02 ` [PATCH 07/12] iio: light: " Pawel Zalewski
@ 2026-10-05 14:02 ` Pawel Zalewski
2026-10-05 14:02 ` [PATCH 09/12] iio: potentiometer: max5487: " Pawel Zalewski
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Pawel Zalewski @ 2026-10-05 14:02 UTC (permalink / raw)
To: Nuno Sá,
Michael Hennerich, Jonathan Cameron, David Lechner,
Andy Shevchenko, Petre Rodan, Matteo Martelli, Marius Cristea,
Matti Vaittinen, Lorenzo Bianconi, Alex Lanzano, Jagath Jog J,
Jean-Baptiste Maneyrol, Kevin Tsai, Eddie James, Marcelo Schmitt
Cc: linux, linux-iio, linux-kernel, Pawel Zalewski
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@thegoodpenguin.co.uk>
---
drivers/iio/magnetometer/ak8975.c | 14 +++++++-------
drivers/iio/magnetometer/mmc35240.c | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
index 8b0c07f82602..1a829a9b91e4 100644
--- a/drivers/iio/magnetometer/ak8975.c
+++ b/drivers/iio/magnetometer/ak8975.c
@@ -1119,13 +1119,13 @@ static DEFINE_RUNTIME_DEV_PM_OPS(ak8975_dev_pm_ops, ak8975_runtime_suspend,
ak8975_runtime_resume, NULL);
static const struct acpi_device_id ak_acpi_match[] = {
- {"AK8963", (kernel_ulong_t)&ak_def_array[AK8963] },
- {"AK8975", (kernel_ulong_t)&ak_def_array[AK8975] },
- {"AK009911", (kernel_ulong_t)&ak_def_array[AK09911] },
- {"AK09911", (kernel_ulong_t)&ak_def_array[AK09911] },
- {"AK09912", (kernel_ulong_t)&ak_def_array[AK09912] },
- {"AKM9911", (kernel_ulong_t)&ak_def_array[AK09911] },
- {"INVN6500", (kernel_ulong_t)&ak_def_array[AK8963] },
+ { .id = "AK8963", .driver_data = (kernel_ulong_t)&ak_def_array[AK8963] },
+ { .id = "AK8975", .driver_data = (kernel_ulong_t)&ak_def_array[AK8975] },
+ { .id = "AK009911", .driver_data = (kernel_ulong_t)&ak_def_array[AK09911] },
+ { .id = "AK09911", .driver_data = (kernel_ulong_t)&ak_def_array[AK09911] },
+ { .id = "AK09912", .driver_data = (kernel_ulong_t)&ak_def_array[AK09912] },
+ { .id = "AKM9911", .driver_data = (kernel_ulong_t)&ak_def_array[AK09911] },
+ { .id = "INVN6500", .driver_data = (kernel_ulong_t)&ak_def_array[AK8963] },
{ }
};
MODULE_DEVICE_TABLE(acpi, ak_acpi_match);
diff --git a/drivers/iio/magnetometer/mmc35240.c b/drivers/iio/magnetometer/mmc35240.c
index 6f40cba4b1ba..310058fe5c07 100644
--- a/drivers/iio/magnetometer/mmc35240.c
+++ b/drivers/iio/magnetometer/mmc35240.c
@@ -553,7 +553,7 @@ static const struct of_device_id mmc35240_of_match[] = {
MODULE_DEVICE_TABLE(of, mmc35240_of_match);
static const struct acpi_device_id mmc35240_acpi_match[] = {
- {"MMC35240", 0},
+ { .id = "MMC35240" },
{ }
};
MODULE_DEVICE_TABLE(acpi, mmc35240_acpi_match);
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 09/12] iio: potentiometer: max5487: use named initializers for acpi_device_id
2026-10-05 14:01 [PATCH 00/12] iio: use designated initializers for acpi_device_id Pawel Zalewski
` (7 preceding siblings ...)
2026-10-05 14:02 ` [PATCH 08/12] iio: magnetometer: " Pawel Zalewski
@ 2026-10-05 14:02 ` Pawel Zalewski
2026-10-05 14:02 ` [PATCH 10/12] iio: pressure: " Pawel Zalewski
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Pawel Zalewski @ 2026-10-05 14:02 UTC (permalink / raw)
To: Nuno Sá,
Michael Hennerich, Jonathan Cameron, David Lechner,
Andy Shevchenko, Petre Rodan, Matteo Martelli, Marius Cristea,
Matti Vaittinen, Lorenzo Bianconi, Alex Lanzano, Jagath Jog J,
Jean-Baptiste Maneyrol, Kevin Tsai, Eddie James, Marcelo Schmitt
Cc: linux, linux-iio, linux-kernel, Pawel Zalewski
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.
Signed-off-by: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
---
drivers/iio/potentiometer/max5487.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/potentiometer/max5487.c b/drivers/iio/potentiometer/max5487.c
index 1f0d0056f412..d1eb0309d123 100644
--- a/drivers/iio/potentiometer/max5487.c
+++ b/drivers/iio/potentiometer/max5487.c
@@ -133,9 +133,9 @@ static const struct spi_device_id max5487_id[] = {
MODULE_DEVICE_TABLE(spi, max5487_id);
static const struct acpi_device_id max5487_acpi_match[] = {
- { "MAX5487", 10 },
- { "MAX5488", 50 },
- { "MAX5489", 100 },
+ { .id = "MAX5487", .driver_data = 10 },
+ { .id = "MAX5488", .driver_data = 50 },
+ { .id = "MAX5489", .driver_data = 100 },
{ }
};
MODULE_DEVICE_TABLE(acpi, max5487_acpi_match);
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 10/12] iio: pressure: use named initializers for acpi_device_id
2026-10-05 14:01 [PATCH 00/12] iio: use designated initializers for acpi_device_id Pawel Zalewski
` (8 preceding siblings ...)
2026-10-05 14:02 ` [PATCH 09/12] iio: potentiometer: max5487: " Pawel Zalewski
@ 2026-10-05 14:02 ` Pawel Zalewski
2026-10-05 14:02 ` [PATCH 11/12] iio: proximity: " Pawel Zalewski
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Pawel Zalewski @ 2026-10-05 14:02 UTC (permalink / raw)
To: Nuno Sá,
Michael Hennerich, Jonathan Cameron, David Lechner,
Andy Shevchenko, Petre Rodan, Matteo Martelli, Marius Cristea,
Matti Vaittinen, Lorenzo Bianconi, Alex Lanzano, Jagath Jog J,
Jean-Baptiste Maneyrol, Kevin Tsai, Eddie James, Marcelo Schmitt
Cc: linux, linux-iio, linux-kernel, Pawel Zalewski
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@thegoodpenguin.co.uk>
---
drivers/iio/pressure/dps310.c | 2 +-
drivers/iio/pressure/hp206c.c | 2 +-
drivers/iio/pressure/st_pressure_i2c.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/pressure/dps310.c b/drivers/iio/pressure/dps310.c
index 45bdb8c7670f..5b5d6bfde91b 100644
--- a/drivers/iio/pressure/dps310.c
+++ b/drivers/iio/pressure/dps310.c
@@ -892,7 +892,7 @@ static const struct i2c_device_id dps310_id[] = {
MODULE_DEVICE_TABLE(i2c, dps310_id);
static const struct acpi_device_id dps310_acpi_match[] = {
- { "IFX3100" },
+ { .id = "IFX3100" },
{ }
};
MODULE_DEVICE_TABLE(acpi, dps310_acpi_match);
diff --git a/drivers/iio/pressure/hp206c.c b/drivers/iio/pressure/hp206c.c
index ee34c8908b74..29797dd9af85 100644
--- a/drivers/iio/pressure/hp206c.c
+++ b/drivers/iio/pressure/hp206c.c
@@ -400,7 +400,7 @@ static const struct i2c_device_id hp206c_id[] = {
MODULE_DEVICE_TABLE(i2c, hp206c_id);
static const struct acpi_device_id hp206c_acpi_match[] = {
- {"HOP206C", 0},
+ { .id = "HOP206C" },
{ }
};
MODULE_DEVICE_TABLE(acpi, hp206c_acpi_match);
diff --git a/drivers/iio/pressure/st_pressure_i2c.c b/drivers/iio/pressure/st_pressure_i2c.c
index 2b7c84b7e6b4..2d630cde19ac 100644
--- a/drivers/iio/pressure/st_pressure_i2c.c
+++ b/drivers/iio/pressure/st_pressure_i2c.c
@@ -54,7 +54,7 @@ static const struct of_device_id st_press_of_match[] = {
MODULE_DEVICE_TABLE(of, st_press_of_match);
static const struct acpi_device_id st_press_acpi_match[] = {
- {"SNO9210", LPS22HB},
+ { .id = "SNO9210", .driver_data = LPS22HB },
{ }
};
MODULE_DEVICE_TABLE(acpi, st_press_acpi_match);
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 11/12] iio: proximity: use named initializers for acpi_device_id
2026-10-05 14:01 [PATCH 00/12] iio: use designated initializers for acpi_device_id Pawel Zalewski
` (9 preceding siblings ...)
2026-10-05 14:02 ` [PATCH 10/12] iio: pressure: " Pawel Zalewski
@ 2026-10-05 14:02 ` Pawel Zalewski
2026-10-05 14:02 ` [PATCH 12/12] iio: temperature: max30208: " Pawel Zalewski
2026-10-06 7:26 ` [PATCH 00/12] iio: use designated " Joshua Crofts
12 siblings, 0 replies; 14+ messages in thread
From: Pawel Zalewski @ 2026-10-05 14:02 UTC (permalink / raw)
To: Nuno Sá,
Michael Hennerich, Jonathan Cameron, David Lechner,
Andy Shevchenko, Petre Rodan, Matteo Martelli, Marius Cristea,
Matti Vaittinen, Lorenzo Bianconi, Alex Lanzano, Jagath Jog J,
Jean-Baptiste Maneyrol, Kevin Tsai, Eddie James, Marcelo Schmitt
Cc: linux, linux-iio, linux-kernel, Pawel Zalewski
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@thegoodpenguin.co.uk>
---
drivers/iio/proximity/sx9310.c | 4 ++--
drivers/iio/proximity/sx9500.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/proximity/sx9310.c b/drivers/iio/proximity/sx9310.c
index 79ba46d8a0aa..8c197973479a 100644
--- a/drivers/iio/proximity/sx9310.c
+++ b/drivers/iio/proximity/sx9310.c
@@ -992,8 +992,8 @@ static const struct sx931x_info sx9311_info = {
};
static const struct acpi_device_id sx9310_acpi_match[] = {
- { "STH9310", (kernel_ulong_t)&sx9310_info },
- { "STH9311", (kernel_ulong_t)&sx9311_info },
+ { .id = "STH9310", .driver_data = (kernel_ulong_t)&sx9310_info },
+ { .id = "STH9311", .driver_data = (kernel_ulong_t)&sx9311_info },
{ }
};
MODULE_DEVICE_TABLE(acpi, sx9310_acpi_match);
diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c
index dadce9b44227..cd67d88d2be4 100644
--- a/drivers/iio/proximity/sx9500.c
+++ b/drivers/iio/proximity/sx9500.c
@@ -1012,8 +1012,8 @@ static int sx9500_resume(struct device *dev)
static DEFINE_SIMPLE_DEV_PM_OPS(sx9500_pm_ops, sx9500_suspend, sx9500_resume);
static const struct acpi_device_id sx9500_acpi_match[] = {
- {"SSX9500", 0},
- {"SASX9500", 0},
+ { .id = "SSX9500" },
+ { .id = "SASX9500" },
{ }
};
MODULE_DEVICE_TABLE(acpi, sx9500_acpi_match);
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 12/12] iio: temperature: max30208: use named initializers for acpi_device_id
2026-10-05 14:01 [PATCH 00/12] iio: use designated initializers for acpi_device_id Pawel Zalewski
` (10 preceding siblings ...)
2026-10-05 14:02 ` [PATCH 11/12] iio: proximity: " Pawel Zalewski
@ 2026-10-05 14:02 ` Pawel Zalewski
2026-10-06 7:26 ` [PATCH 00/12] iio: use designated " Joshua Crofts
12 siblings, 0 replies; 14+ messages in thread
From: Pawel Zalewski @ 2026-10-05 14:02 UTC (permalink / raw)
To: Nuno Sá,
Michael Hennerich, Jonathan Cameron, David Lechner,
Andy Shevchenko, Petre Rodan, Matteo Martelli, Marius Cristea,
Matti Vaittinen, Lorenzo Bianconi, Alex Lanzano, Jagath Jog J,
Jean-Baptiste Maneyrol, Kevin Tsai, Eddie James, Marcelo Schmitt
Cc: linux, linux-iio, linux-kernel, Pawel Zalewski
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.
Signed-off-by: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
---
drivers/iio/temperature/max30208.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/temperature/max30208.c b/drivers/iio/temperature/max30208.c
index 6172abc6d533..80c148da1723 100644
--- a/drivers/iio/temperature/max30208.c
+++ b/drivers/iio/temperature/max30208.c
@@ -224,7 +224,7 @@ static const struct i2c_device_id max30208_id_table[] = {
MODULE_DEVICE_TABLE(i2c, max30208_id_table);
static const struct acpi_device_id max30208_acpi_match[] = {
- { "MAX30208" },
+ { .id = "MAX30208" },
{ }
};
MODULE_DEVICE_TABLE(acpi, max30208_acpi_match);
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 00/12] iio: use designated initializers for acpi_device_id
2026-10-05 14:01 [PATCH 00/12] iio: use designated initializers for acpi_device_id Pawel Zalewski
` (11 preceding siblings ...)
2026-10-05 14:02 ` [PATCH 12/12] iio: temperature: max30208: " Pawel Zalewski
@ 2026-10-06 7:26 ` Joshua Crofts
12 siblings, 0 replies; 14+ messages in thread
From: Joshua Crofts @ 2026-10-06 7:26 UTC (permalink / raw)
To: Pawel Zalewski, Eddie James
Cc: Nuno Sá,
Michael Hennerich, Jonathan Cameron, David Lechner,
Andy Shevchenko, Petre Rodan, Matteo Martelli, Marius Cristea,
Matti Vaittinen, Lorenzo Bianconi, Alex Lanzano, Jagath Jog J,
Jean-Baptiste Maneyrol, Kevin Tsai, Marcelo Schmitt, linux,
linux-iio, linux-kernel
On Mon, 05 Oct 2026 15:01:56 +0100
Pawel Zalewski <pzalewski@thegoodpenguin.co.uk> wrote:
> This series is converting lists that contain the acpi_device_id struct,
> which is defined in the include/linux/device-id/acpi.h to make use of named
> initializers (which they do not use currently). This work is part of the on
> going effort in the kernel associated with device-ids [1]
>
> The plan is to convert acpi_device_id::driver_data to have an anonymous
> union, similarly to what was introduced for PCI and I2C device ID tables.
> The goal is to increase type-safety (most of the existing casts are gone),
> to improve readability and to make use intent a bit more clear:
>
> ```
> union {
> kernel_ulong_t driver_data;
> const void *driver_data_ptr;
> }
> ```
>
> But for that to work all lists containing the structs need to use named
> initializers first to avoid triggering -Wmissing-braces. I already have
> patches that implement this and touching a lot of kernel subsystmes that
> use the acpi_device_id struct and that list keeps on growing. Therefore,
> I have decided to split the series per every subsystem into:
> - pre-clean-ups that convert the lists to use named initializers
> (which is this series)
> - actual implementations that make some of the modules use the new
> driver_data_ptr member
>
> That way the task can be fragmented into manageable and independent chunks
> of work and makes this effort easier to review.
>
> Tested builds on x86-64 and a64 in Yocto using 7.3-rc6.
>
> [1] https://lore.kernel.org/all/cover.1780048925.git.u.kleine-koenig@baylibre.com/
>
> Signed-off-by: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
> ---
So I guess that's IIO done when it comes to C99 initializers.
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 14+ messages in thread