diff options
| author | Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> | 2026-02-05 16:12:07 +0300 |
|---|---|---|
| committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2026-03-04 00:20:01 +0300 |
| commit | 042d1244786ce713da25ea26cce71e7e90be7580 (patch) | |
| tree | ac961be684d1236e76796263fb9117f7340711ff | |
| parent | 7affc01b317819eb426f6c0aa2fd98be73080b75 (diff) | |
| download | linux-042d1244786ce713da25ea26cce71e7e90be7580.tar.xz | |
iio: sca3000: reuse device pointer for devm helpers
Cache struct device *dev and feed it to the devm helpers to simplify
the probe function. No functional changes.
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| -rw-r--r-- | drivers/iio/accel/sca3000.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c index 096f9726ae1f..9b1b4c512199 100644 --- a/drivers/iio/accel/sca3000.c +++ b/drivers/iio/accel/sca3000.c @@ -1429,11 +1429,12 @@ static const struct iio_info sca3000_info = { static int sca3000_probe(struct spi_device *spi) { - int ret; + struct device *dev = &spi->dev; struct sca3000_state *st; struct iio_dev *indio_dev; + 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; @@ -1455,8 +1456,7 @@ static int sca3000_probe(struct spi_device *spi) } indio_dev->modes = INDIO_DIRECT_MODE; - ret = devm_iio_kfifo_buffer_setup(&spi->dev, indio_dev, - &sca3000_ring_setup_ops); + ret = devm_iio_kfifo_buffer_setup(dev, indio_dev, &sca3000_ring_setup_ops); if (ret) return ret; |
