Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Rodrigo Alencar and committed by
Jonathan Cameron
d9eece6f 5593bddb

+2 -1
+2 -1
drivers/iio/amplifiers/ad8366.c
··· 248 248 249 249 static int ad8366_probe(struct spi_device *spi) 250 250 { 251 + struct device *dev = &spi->dev; 251 252 struct iio_dev *indio_dev; 252 253 struct ad8366_state *st; 253 254 int ret; 254 255 255 - indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); 256 + indio_dev = devm_iio_device_alloc(dev, sizeof(*st)); 256 257 if (indio_dev == NULL) 257 258 return -ENOMEM; 258 259