The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: "Matteo Martelli" <matteomartelli3@gmail.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Mikael Gonella-Bolduc" <m.gonella.bolduc@gmail.com>,
	"Linus Walleij" <linusw@kernel.org>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	linux-iio@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/2] iio: Drop unused driver_data in four i2c drivers
Date: Tue, 12 May 2026 15:01:28 +0100	[thread overview]
Message-ID: <20260512150128.79c4408b@jic23-huawei> (raw)
In-Reply-To: <8e07be10e69b5699bba7ef70533a0d49f8cc1eb1.1778582187.git.u.kleine-koenig@baylibre.com>

On Tue, 12 May 2026 14:50:34 +0200
Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> wrote:

> For the four drivers the .driver_data member of i2c_device_id is
> write-only. Drop the explicit assignment.
> 
> While touching these arrays use a named initializer to assign the .name
> member, which is easier to parse for a human.
> 
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>

Given these are obviously a good idea and the other cases I called out
are more complex so probably want their own patches...

Applied to the testing branch of iio.git

Thanks

Jonathan

> ---
>  drivers/iio/adc/pac1921.c    | 2 +-
>  drivers/iio/light/apds9160.c | 2 +-
>  drivers/iio/light/tsl2563.c  | 8 ++++----
>  drivers/iio/light/tsl2583.c  | 6 +++---
>  4 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/iio/adc/pac1921.c b/drivers/iio/adc/pac1921.c
> index bce7185953ec..68bdd2f30bad 100644
> --- a/drivers/iio/adc/pac1921.c
> +++ b/drivers/iio/adc/pac1921.c
> @@ -1310,7 +1310,7 @@ static int pac1921_probe(struct i2c_client *client)
>  }
>  
>  static const struct i2c_device_id pac1921_id[] = {
> -	{ .name = "pac1921", 0 },
> +	{ .name = "pac1921" },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(i2c, pac1921_id);
> diff --git a/drivers/iio/light/apds9160.c b/drivers/iio/light/apds9160.c
> index 3da0bdac04cf..8dacb1730429 100644
> --- a/drivers/iio/light/apds9160.c
> +++ b/drivers/iio/light/apds9160.c
> @@ -1572,7 +1572,7 @@ static const struct of_device_id apds9160_of_match[] = {
>  MODULE_DEVICE_TABLE(of, apds9160_of_match);
>  
>  static const struct i2c_device_id apds9160_id[] = {
> -	{ "apds9160", 0 },
> +	{ .name = "apds9160" },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(i2c, apds9160_id);
> diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
> index f2af1cd7c2d1..7e277bc6a8b1 100644
> --- a/drivers/iio/light/tsl2563.c
> +++ b/drivers/iio/light/tsl2563.c
> @@ -839,10 +839,10 @@ static DEFINE_SIMPLE_DEV_PM_OPS(tsl2563_pm_ops, tsl2563_suspend,
>  				tsl2563_resume);
>  
>  static const struct i2c_device_id tsl2563_id[] = {
> -	{ "tsl2560", 0 },
> -	{ "tsl2561", 1 },
> -	{ "tsl2562", 2 },
> -	{ "tsl2563", 3 },
> +	{ .name = "tsl2560" },
> +	{ .name = "tsl2561" },
> +	{ .name = "tsl2562" },
> +	{ .name = "tsl2563" },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(i2c, tsl2563_id);
> diff --git a/drivers/iio/light/tsl2583.c b/drivers/iio/light/tsl2583.c
> index 8801a491de77..a0dd122af2cf 100644
> --- a/drivers/iio/light/tsl2583.c
> +++ b/drivers/iio/light/tsl2583.c
> @@ -913,9 +913,9 @@ static DEFINE_RUNTIME_DEV_PM_OPS(tsl2583_pm_ops, tsl2583_suspend,
>  				 tsl2583_resume, NULL);
>  
>  static const struct i2c_device_id tsl2583_idtable[] = {
> -	{ "tsl2580", 0 },
> -	{ "tsl2581", 1 },
> -	{ "tsl2583", 2 },
> +	{ .name = "tsl2580" },
> +	{ .name = "tsl2581" },
> +	{ .name = "tsl2583" },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(i2c, tsl2583_idtable);


  reply	other threads:[~2026-05-12 14:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 12:50 [PATCH v1 0/2] iio: Rework i2c_device_id initialisation Uwe Kleine-König (The Capable Hub)
2026-05-12 12:50 ` [PATCH v1 1/2] iio: Drop unused driver_data in four i2c drivers Uwe Kleine-König (The Capable Hub)
2026-05-12 14:01   ` Jonathan Cameron [this message]
2026-05-12 12:50 ` [PATCH v1 2/2] iio: Initialize i2c_device_id arrays using member names Uwe Kleine-König (The Capable Hub)
2026-05-12 13:16   ` Linus Walleij
2026-05-12 14:00   ` Jonathan Cameron

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=20260512150128.79c4408b@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linusw@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.gonella.bolduc@gmail.com \
    --cc=matteomartelli3@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=u.kleine-koenig@baylibre.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox