Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: ad7124: drop use of chip info array
Date: Tue, 1 Jul 2025 18:37:51 +0100	[thread overview]
Message-ID: <20250701183751.5701fb7e@jic23-huawei> (raw)
In-Reply-To: <pmqc36lr7filq6gu6bplg62qb4bx7cc7nx3ylsjuczv52cdlxr@2bdgzwobw3mv>

On Mon, 30 Jun 2025 10:15:14 +0200
Uwe Kleine-König <u.kleine-koenig@baylibre.com> wrote:

> Hello Jonathan,
> 
> On Sun, Jun 29, 2025 at 06:25:31PM +0100, Jonathan Cameron wrote:
> > > ---
> > >  drivers/iio/adc/ad7124.c | 36 ++++++++++++++----------------------
> > >  1 file changed, 14 insertions(+), 22 deletions(-)
> > > 
> > > diff --git a/drivers/iio/adc/ad7124.c b/drivers/iio/adc/ad7124.c
> > > index 92596f15e797378329d2072bff71e392664c69db..9808df2e92424283a86e9c105492c7447d071e44 100644
> > > --- a/drivers/iio/adc/ad7124.c
> > > +++ b/drivers/iio/adc/ad7124.c
> > > @@ -94,11 +94,6 @@
> > >  
> > >  /* AD7124 input sources */
> > >  
> > > -enum ad7124_ids {
> > > -	ID_AD7124_4,
> > > -	ID_AD7124_8,
> > > -};
> > > -
> > >  enum ad7124_ref_sel {
> > >  	AD7124_REFIN1,
> > >  	AD7124_REFIN2,
> > > @@ -193,17 +188,16 @@ struct ad7124_state {
> > >  	DECLARE_KFIFO(live_cfgs_fifo, struct ad7124_channel_config *, AD7124_MAX_CONFIGS);
> > >  };
> > >  
> > > -static struct ad7124_chip_info ad7124_chip_info_tbl[] = {
> > > -	[ID_AD7124_4] = {
> > > -		.name = "ad7124-4",
> > > -		.chip_id = AD7124_ID_DEVICE_ID_AD7124_4,
> > > -		.num_inputs = 8,
> > > -	},
> > > -	[ID_AD7124_8] = {
> > > -		.name = "ad7124-8",
> > > -		.chip_id = AD7124_ID_DEVICE_ID_AD7124_8,
> > > -		.num_inputs = 16,
> > > -	},
> > > +static const struct ad7124_chip_info ad7124_4_chip_info = {
> > > +	.name = "ad7124-4",
> > > +	.chip_id = AD7124_ID_DEVICE_ID_AD7124_4,
> > > +	.num_inputs = 8,
> > > +};
> > > +
> > > +static const struct ad7124_chip_info ad7124_8_chip_info = {
> > > +	.name = "ad7124-8",
> > > +	.chip_id = AD7124_ID_DEVICE_ID_AD7124_8,
> > > +	.num_inputs = 16,
> > >  };
> > >  
> > >  static int ad7124_find_closest_match(const int *array,
> > > @@ -1341,17 +1335,15 @@ static int ad7124_probe(struct spi_device *spi)
> > >  }
> > >  
> > >  static const struct of_device_id ad7124_of_match[] = {
> > > -	{ .compatible = "adi,ad7124-4",
> > > -		.data = &ad7124_chip_info_tbl[ID_AD7124_4], },
> > > -	{ .compatible = "adi,ad7124-8",
> > > -		.data = &ad7124_chip_info_tbl[ID_AD7124_8], },
> > > +	{ .compatible = "adi,ad7124-4", .data = &ad7124_4_chip_info },
> > > +	{ .compatible = "adi,ad7124-8", .data = &ad7124_8_chip_info },
> > >  	{ }
> > >  };
> > >  MODULE_DEVICE_TABLE(of, ad7124_of_match);
> > >  
> > >  static const struct spi_device_id ad71124_ids[] = {
> > > -	{ "ad7124-4", (kernel_ulong_t)&ad7124_chip_info_tbl[ID_AD7124_4] },
> > > -	{ "ad7124-8", (kernel_ulong_t)&ad7124_chip_info_tbl[ID_AD7124_8] },
> > > +	{ "ad7124-4", (kernel_ulong_t)&ad7124_4_chip_info },
> > > +	{ "ad7124-8", (kernel_ulong_t)&ad7124_8_chip_info },
> > >  	{ }
> > >  };
> > >  MODULE_DEVICE_TABLE(spi, ad71124_ids);  
> 
> The patch looks fine for me. I remember having considered creating such
> a patch, too.
> 
> Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Applied.  Thanks

> 
> Best regards
> Uwe


  reply	other threads:[~2025-07-01 17:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-28 16:16 [PATCH] iio: adc: ad7124: drop use of chip info array David Lechner
2025-06-29 17:25 ` Jonathan Cameron
2025-06-30  8:15   ` Uwe Kleine-König
2025-07-01 17:37     ` Jonathan Cameron [this message]
2025-07-02  6:56       ` Uwe Kleine-König
2025-07-06  9:48         ` 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=20250701183751.5701fb7e@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.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