From: "Nuno Sá" <noname.nuno@gmail.com>
To: Tomas Melin <tomas.melin@vaisala.com>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Nuno Sa <nuno.sa@analog.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Jonathan Cameron <jic23@kernel.org>,
David Lechner <dlechner@baylibre.com>,
Andy Shevchenko <andy@kernel.org>,
Olivier Moysan <olivier.moysan@foss.st.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@intel.com>
Subject: Re: [PATCH v7 5/6] iio: adc: ad9467: simplify device pointer in probe
Date: Tue, 10 Feb 2026 12:11:49 +0000 [thread overview]
Message-ID: <642f9ed3c426ecfff250b9d00dd822c595e0fdfd.camel@gmail.com> (raw)
In-Reply-To: <20260210-b4-ad9467-optional-backend-v7-5-7a590ffe02df@vaisala.com>
On Tue, 2026-02-10 at 10:53 +0000, Tomas Melin wrote:
> Create alias for the device pointer to simplify referencing
> and keeping syntax and column width shorter.
>
> Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
> ---
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
> drivers/iio/adc/ad9467.c | 19 ++++++++++---------
> 1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c
> index 59c3fa3bcc9b..ae9139290c22 100644
> --- a/drivers/iio/adc/ad9467.c
> +++ b/drivers/iio/adc/ad9467.c
> @@ -1283,12 +1283,13 @@ static void ad9467_debugfs_init(struct iio_dev *indio_dev)
>
> static int ad9467_probe(struct spi_device *spi)
> {
> + struct device *dev = &spi->dev;
> struct iio_dev *indio_dev;
> struct ad9467_state *st;
> unsigned int id;
> int ret;
>
> - indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
> + indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
> if (!indio_dev)
> return -ENOMEM;
>
> @@ -1303,16 +1304,16 @@ static int ad9467_probe(struct spi_device *spi)
> if (AD9467_CAN_INVERT(st))
> st->calib_map_size *= 2;
>
> - st->clk = devm_clk_get_enabled(&spi->dev, "adc-clk");
> + st->clk = devm_clk_get_enabled(dev, "adc-clk");
> if (IS_ERR(st->clk))
> return PTR_ERR(st->clk);
>
> - st->pwrdown_gpio = devm_gpiod_get_optional(&spi->dev, "powerdown",
> + st->pwrdown_gpio = devm_gpiod_get_optional(dev, "powerdown",
> GPIOD_OUT_LOW);
> if (IS_ERR(st->pwrdown_gpio))
> return PTR_ERR(st->pwrdown_gpio);
>
> - ret = ad9467_reset(&spi->dev);
> + ret = ad9467_reset(dev);
> if (ret)
> return ret;
>
> @@ -1322,8 +1323,8 @@ static int ad9467_probe(struct spi_device *spi)
>
> id = ad9467_spi_read(st, AN877_ADC_REG_CHIP_ID);
> if (id != st->info->id) {
> - dev_err(&spi->dev, "Mismatch CHIP_ID, got 0x%X, expected 0x%X\n",
> - id, st->info->id);
> + dev_err(dev, "Mismatch CHIP_ID, got 0x%X, expected 0x%X\n", id,
> + st->info->id);
> return -ENODEV;
> }
>
> @@ -1339,11 +1340,11 @@ static int ad9467_probe(struct spi_device *spi)
> if (ret)
> return ret;
>
> - ret = devm_iio_backend_request_buffer(&spi->dev, st->back, indio_dev);
> + ret = devm_iio_backend_request_buffer(dev, st->back, indio_dev);
> if (ret)
> return ret;
>
> - ret = devm_iio_backend_enable(&spi->dev, st->back);
> + ret = devm_iio_backend_enable(dev, st->back);
> if (ret)
> return ret;
>
> @@ -1351,7 +1352,7 @@ static int ad9467_probe(struct spi_device *spi)
> if (ret)
> return ret;
>
> - ret = devm_iio_device_register(&spi->dev, indio_dev);
> + ret = devm_iio_device_register(dev, indio_dev);
> if (ret)
> return ret;
>
next prev parent reply other threads:[~2026-02-10 12:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 10:53 [PATCH v7 0/6] iio: adc: ad9467: Support alternative backends Tomas Melin
2026-02-10 10:53 ` [PATCH v7 1/6] iio: industrialio-backend: support backend capabilities Tomas Melin
2026-02-10 10:53 ` [PATCH v7 2/6] iio: adc: adi-axi-adc: define supported iio-backend capabilities Tomas Melin
2026-02-10 10:53 ` [PATCH v7 3/6] iio: dac: adi-axi-dac: " Tomas Melin
2026-02-10 10:53 ` [PATCH v7 4/6] iio: adc: sd_adc_modulator: " Tomas Melin
2026-02-10 10:53 ` [PATCH v7 5/6] iio: adc: ad9467: simplify device pointer in probe Tomas Melin
2026-02-10 12:11 ` Nuno Sá [this message]
2026-02-10 15:00 ` Andy Shevchenko
2026-02-10 10:53 ` [PATCH v7 6/6] iio: adc: ad9467: check for backend capabilities Tomas Melin
2026-02-14 15:57 ` [PATCH v7 0/6] iio: adc: ad9467: Support alternative backends 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=642f9ed3c426ecfff250b9d00dd822c595e0fdfd.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=olivier.moysan@foss.st.com \
--cc=tomas.melin@vaisala.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