mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: Jonathan Santos <Jonathan.Santos@analog.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: lars@metafoo.de, jic23@kernel.org, nuno.sa@analog.com,
	andy@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, marcelo.schmitt1@gmail.com,
	jonath4nns@gmail.com
Subject: Re: [PATCH v3 2/4] iio: adc: ad7768-1: introduce chip info for future multidevice support
Date: Fri, 5 Sep 2025 12:06:42 -0500	[thread overview]
Message-ID: <09cbea15-1b14-4a0e-b643-563253e2a918@baylibre.com> (raw)
In-Reply-To: <098a8b2556ea95fdce5f81cbac98983f91ca1a9d.1757001160.git.Jonathan.Santos@analog.com>

On 9/5/25 4:49 AM, Jonathan Santos wrote:
> Add Chip info struct in SPI device to store channel information for
> each supported part.
> 

...

> @@ -1371,9 +1387,14 @@ static int ad7768_probe(struct spi_device *spi)
>  
>  	st->mclk_freq = clk_get_rate(st->mclk);
>  
> -	indio_dev->channels = ad7768_channels;
> -	indio_dev->num_channels = ARRAY_SIZE(ad7768_channels);
> -	indio_dev->name = spi_get_device_id(spi)->name;
> +	st->chip = spi_get_device_match_data(spi);

Generally, we want this early in probe so that chip info is available as early
as possible. Might not need it now, but would save us from having to move this
later if we ever do.

> +	if (!st->chip)
> +		return dev_err_probe(&spi->dev, -ENODEV,
> +				     "Could not find chip info data\n");
> +

  parent reply	other threads:[~2025-09-05 17:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-05  9:48 [PATCH v3 0/4] Add support for ADAQ776x-1 ADC Family Jonathan Santos
2025-09-05  9:49 ` [PATCH v3 1/4] dt-bindings: iio: adc: ad7768-1: add new supported parts Jonathan Santos
2025-09-05 17:06   ` David Lechner
2025-09-05  9:49 ` [PATCH v3 2/4] iio: adc: ad7768-1: introduce chip info for future multidevice support Jonathan Santos
2025-09-05 16:51   ` Andy Shevchenko
2025-09-05 17:06   ` David Lechner [this message]
2025-09-05  9:49 ` [PATCH v3 3/4] math.h: Add 64-bit fractional numbers types Jonathan Santos
2025-09-05 16:45   ` Andy Shevchenko
2025-09-05  9:49 ` [PATCH v3 4/4] iio: adc: ad7768-1: add support for ADAQ776x-1 ADC Family Jonathan Santos
2025-09-05 17:08   ` David Lechner
2025-09-05 17:23   ` Andy Shevchenko
2025-09-05 17:25     ` Andy Shevchenko
2025-09-07 10:56     ` 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=09cbea15-1b14-4a0e-b643-563253e2a918@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=Jonathan.Santos@analog.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=jonath4nns@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    /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

all inboxes | Powered by JetHome®