[PATCH 1/4] iio: frequency: admv4420: add dev variable

Antoniu Miclaus posted 4 patches 1 month ago
There is a newer version of this series
[PATCH 1/4] iio: frequency: admv4420: add dev variable
Posted by Antoniu Miclaus 1 month ago
Introduce a local struct device variable in admv4420_probe() to
simplify subsequent conversions and improve code readability.

No functional change.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
 drivers/iio/frequency/admv4420.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/frequency/admv4420.c b/drivers/iio/frequency/admv4420.c
index 8748d9747639..6ebfe08fc211 100644
--- a/drivers/iio/frequency/admv4420.c
+++ b/drivers/iio/frequency/admv4420.c
@@ -344,18 +344,19 @@ static int admv4420_setup(struct iio_dev *indio_dev)
 
 static int admv4420_probe(struct spi_device *spi)
 {
+	struct device *dev = &spi->dev;
 	struct iio_dev *indio_dev;
 	struct admv4420_state *st;
 	struct regmap *regmap;
 	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;
 
 	regmap = devm_regmap_init_spi(spi, &admv4420_regmap_config);
 	if (IS_ERR(regmap))
-		return dev_err_probe(&spi->dev, PTR_ERR(regmap),
+		return dev_err_probe(dev, PTR_ERR(regmap),
 				     "Failed to initializing spi regmap\n");
 
 	st = iio_priv(indio_dev);
@@ -373,7 +374,7 @@ static int admv4420_probe(struct spi_device *spi)
 		return ret;
 	}
 
-	return devm_iio_device_register(&spi->dev, indio_dev);
+	return devm_iio_device_register(dev, indio_dev);
 }
 
 static const struct of_device_id admv4420_of_match[] = {
-- 
2.43.0
Re: [PATCH 1/4] iio: frequency: admv4420: add dev variable
Posted by Andy Shevchenko 1 month ago
On Fri, Mar 06, 2026 at 12:24:45PM +0200, Antoniu Miclaus wrote:
> Introduce a local struct device variable in admv4420_probe() to
> simplify subsequent conversions and improve code readability.
> 
> No functional change.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko