[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <09cbea15-1b14-4a0e-b643-563253e2a918@baylibre.com>
Date: Fri, 5 Sep 2025 12:06:42 -0500
From: David Lechner <dlechner@...libre.com>
To: Jonathan Santos <Jonathan.Santos@...log.com>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: lars@...afoo.de, jic23@...nel.org, nuno.sa@...log.com, andy@...nel.org,
robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
marcelo.schmitt1@...il.com, jonath4nns@...il.com
Subject: Re: [PATCH v3 2/4] iio: adc: ad7768-1: introduce chip info for future
multidevice support
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");
> +
Powered by blists - more mailing lists