All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matti Vaittinen <mazziesaccount@gmail.com>
To: "Pawel Zalewski" <pzalewski@thegoodpenguin.co.uk>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Petre Rodan" <petre.rodan@subdimension.ro>,
	"Matteo Martelli" <matteomartelli3@gmail.com>,
	"Marius Cristea" <marius.cristea@microchip.com>,
	"Lorenzo Bianconi" <lorenzo@kernel.org>,
	"Alex Lanzano" <lanzano.alex@gmail.com>,
	"Jagath Jog J" <jagathjog1996@gmail.com>,
	"Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.com>,
	"Kevin Tsai" <ktsai@capellamicro.com>,
	"Eddie James" <eajames@linux.ibm.com>,
	"Marcelo Schmitt" <marcelo.schmitt@analog.com>
Cc: linux@analog.com, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/12] iio: accel: use named initializers for acpi_device_id
Date: Mon, 12 Oct 2026 13:59:37 +0300	[thread overview]
Message-ID: <67b5d1a0-23fd-4da8-bc7f-53acaaa6460c@gmail.com> (raw)
In-Reply-To: <20261005-acpi-iio-v1-1-2796f713945a@thegoodpenguin.co.uk>

On 05/10/2026 17:01, Pawel Zalewski wrote:
> 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>

Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>

> ---
>   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" },
>   	{ }
>   };
>   
> 


-- 
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~

  reply	other threads:[~2026-10-12 10:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-12 10:59   ` Matti Vaittinen [this message]
2026-10-05 14:01 ` [PATCH 02/12] iio: adc: " Pawel Zalewski
2026-10-12 10:57   ` Matti Vaittinen
2026-10-05 14:01 ` [PATCH 03/12] iio: dac: " Pawel Zalewski
2026-10-05 14:02 ` [PATCH 04/12] iio: gyro: bmg160_i2c: " Pawel Zalewski
2026-10-05 14:02 ` [PATCH 05/12] iio: humidity: " Pawel Zalewski
2026-10-05 14:02 ` [PATCH 06/12] iio: imu: " Pawel Zalewski
2026-10-05 14:02 ` [PATCH 07/12] iio: light: " Pawel Zalewski
2026-10-12 11:01   ` Matti Vaittinen
2026-10-05 14:02 ` [PATCH 08/12] iio: magnetometer: " Pawel Zalewski
2026-10-05 14:02 ` [PATCH 09/12] iio: potentiometer: max5487: " Pawel Zalewski
2026-10-05 14:02 ` [PATCH 10/12] iio: pressure: " Pawel Zalewski
2026-10-05 14:02 ` [PATCH 11/12] iio: proximity: " 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
2026-10-14 11:32 ` Nuno Sá

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=67b5d1a0-23fd-4da8-bc7f-53acaaa6460c@gmail.com \
    --to=mazziesaccount@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=eajames@linux.ibm.com \
    --cc=jagathjog1996@gmail.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=jic23@kernel.org \
    --cc=ktsai@capellamicro.com \
    --cc=lanzano.alex@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@analog.com \
    --cc=lorenzo@kernel.org \
    --cc=marcelo.schmitt@analog.com \
    --cc=marius.cristea@microchip.com \
    --cc=matteomartelli3@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=petre.rodan@subdimension.ro \
    --cc=pzalewski@thegoodpenguin.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.