From: Rodrigo Alencar Date: Mon, 16 Feb 2026 17:10:48 +0000 (+0000) Subject: iio: amplifiers: ad8366: add local dev pointer to the probe function X-Git-Tag: v7.1-rc1~17^2~120^2~177 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9eece6f39c64b958e590686781e2aa16d7d6ae4;p=thirdparty%2Flinux.git iio: amplifiers: ad8366: add local dev pointer to the probe function Create local device pointer in the probe function to shorten lines, making the code easier to read. The local device pointer replaces &spi->dev and will be reused across other probe function places in later patches. Signed-off-by: Rodrigo Alencar Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/amplifiers/ad8366.c b/drivers/iio/amplifiers/ad8366.c index 8dc639d30dbbb..677d02f4f0757 100644 --- a/drivers/iio/amplifiers/ad8366.c +++ b/drivers/iio/amplifiers/ad8366.c @@ -248,11 +248,12 @@ static const struct iio_chan_spec ada4961_channels[] = { static int ad8366_probe(struct spi_device *spi) { + struct device *dev = &spi->dev; struct iio_dev *indio_dev; struct ad8366_state *st; int ret; - indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); + indio_dev = devm_iio_device_alloc(dev, sizeof(*st)); if (indio_dev == NULL) return -ENOMEM;