[PATCH v4 04/11] iio: amplifiers: ad8366: add local dev pointer to the probe function
From: Rodrigo Alencar via B4 Relay
Date: Tue Feb 10 2026 - 14:43:37 EST
From: Rodrigo Alencar <rodrigo.alencar@xxxxxxxxxx>
Create local device pointer in the probe function to shorten lines,
making the code easier to read.
Signed-off-by: Rodrigo Alencar <rodrigo.alencar@xxxxxxxxxx>
---
drivers/iio/amplifiers/ad8366.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/amplifiers/ad8366.c b/drivers/iio/amplifiers/ad8366.c
index 6382106ee6c7..3456a31cb1ee 100644
--- a/drivers/iio/amplifiers/ad8366.c
+++ b/drivers/iio/amplifiers/ad8366.c
@@ -240,11 +240,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;
--
2.43.0