diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-02-06 22:03:21 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-02-21 22:33:05 +0300 |
commit | dfa258c0660ed2a93d05fe9b7b3d3d652432bab7 (patch) | |
tree | 83bc453216b97043d7960ec88f57d0e53c3bf014 /drivers/staging/iio | |
parent | 9010ac1c7115e1edd69d955ba50098cb3341c84d (diff) | |
download | linux-dfa258c0660ed2a93d05fe9b7b3d3d652432bab7.tar.xz |
staging:iio:adc:ad7280a: Use a local dev pointer to avoid &spi->dev
We use this a few times already and it is about to get worse, so
introduce a local variable to simplify things.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-14-jic23@kernel.org
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r-- | drivers/staging/iio/adc/ad7280a.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index 8635a12f5f84..df4a03f42c7a 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -955,11 +955,12 @@ static const struct ad7280_platform_data ad7793_default_pdata = { static int ad7280_probe(struct spi_device *spi) { const struct ad7280_platform_data *pdata = dev_get_platdata(&spi->dev); + struct device *dev = &spi->dev; struct ad7280_state *st; int ret; struct iio_dev *indio_dev; - indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); + indio_dev = devm_iio_device_alloc(dev, sizeof(*st)); if (!indio_dev) return -ENOMEM; @@ -991,7 +992,7 @@ static int ad7280_probe(struct spi_device *spi) st->aux_threshhigh = 0xFF; st->acquisition_time = pdata->acquisition_time; - ret = devm_add_action_or_reset(&spi->dev, ad7280_sw_power_down, st); + ret = devm_add_action_or_reset(dev, ad7280_sw_power_down, st); if (ret) return ret; @@ -1020,7 +1021,7 @@ static int ad7280_probe(struct spi_device *spi) if (ret) return ret; - ret = devm_request_threaded_irq(&spi->dev, spi->irq, + ret = devm_request_threaded_irq(dev, spi->irq, NULL, ad7280_event_handler, IRQF_TRIGGER_FALLING | @@ -1035,7 +1036,7 @@ static int ad7280_probe(struct spi_device *spi) indio_dev->info = &ad7280_info_no_irq; } - return devm_iio_device_register(&spi->dev, indio_dev); + return devm_iio_device_register(dev, indio_dev); } static const struct spi_device_id ad7280_id[] = { |