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: frequency: admv4420: add dev variable

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>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Antoniu Miclaus and committed by
Jonathan Cameron
e81f3889 b37cce0b

+4 -3
+4 -3
drivers/iio/frequency/admv4420.c
··· 344 344 345 345 static int admv4420_probe(struct spi_device *spi) 346 346 { 347 + struct device *dev = &spi->dev; 347 348 struct iio_dev *indio_dev; 348 349 struct admv4420_state *st; 349 350 struct regmap *regmap; 350 351 int ret; 351 352 352 - indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); 353 + indio_dev = devm_iio_device_alloc(dev, sizeof(*st)); 353 354 if (!indio_dev) 354 355 return -ENOMEM; 355 356 356 357 regmap = devm_regmap_init_spi(spi, &admv4420_regmap_config); 357 358 if (IS_ERR(regmap)) 358 - return dev_err_probe(&spi->dev, PTR_ERR(regmap), 359 + return dev_err_probe(dev, PTR_ERR(regmap), 359 360 "Failed to initializing spi regmap\n"); 360 361 361 362 st = iio_priv(indio_dev); ··· 374 373 return ret; 375 374 } 376 375 377 - return devm_iio_device_register(&spi->dev, indio_dev); 376 + return devm_iio_device_register(dev, indio_dev); 378 377 } 379 378 380 379 static const struct of_device_id admv4420_of_match[] = {