]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: amplifiers: ad8366: add local dev pointer to the probe function
authorRodrigo Alencar <rodrigo.alencar@analog.com>
Mon, 16 Feb 2026 17:10:48 +0000 (17:10 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 23 Feb 2026 21:00:57 +0000 (21:00 +0000)
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 <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/amplifiers/ad8366.c

index 8dc639d30dbbb94d8419e2e29eaac96e8b8bae82..677d02f4f075784d6a3ae884243230a1a87e3059 100644 (file)
@@ -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;