diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-04-01 18:17:57 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-14 09:49:58 +0200 |
commit | 814919a0739ff611c5cc010559987aa2743b68ce (patch) | |
tree | 7d5ef1192437eac195214d6d8a547113273ea419 /drivers/iio/adc | |
parent | 62a560ac4acdd9c938c6c7b3513b9ec2cd1d6f28 (diff) | |
download | kernel_replicant_linux-814919a0739ff611c5cc010559987aa2743b68ce.tar.gz kernel_replicant_linux-814919a0739ff611c5cc010559987aa2743b68ce.tar.bz2 kernel_replicant_linux-814919a0739ff611c5cc010559987aa2743b68ce.zip |
iio:adc:ad7476: Fix remove handling
commit 6baee4bd63f5fdf1716f88e95c21a683e94fe30d upstream.
This driver was in an odd half way state between devm based cleanup
and manual cleanup (most of which was missing).
I would guess something went wrong with a rebase or similar.
Anyhow, this basically finishes the job as a precursor to improving
the regulator handling.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Fixes: 4bb2b8f94ace3 ("iio: adc: ad7476: implement devm_add_action_or_reset")
Cc: Michael Hennerich <michael.hennerich@analog.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210401171759.318140-2-jic23@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r-- | drivers/iio/adc/ad7476.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/iio/adc/ad7476.c b/drivers/iio/adc/ad7476.c index 66c55ae67791..bf5572670244 100644 --- a/drivers/iio/adc/ad7476.c +++ b/drivers/iio/adc/ad7476.c @@ -316,25 +316,15 @@ static int ad7476_probe(struct spi_device *spi) spi_message_init(&st->msg); spi_message_add_tail(&st->xfer, &st->msg); - ret = iio_triggered_buffer_setup(indio_dev, NULL, - &ad7476_trigger_handler, NULL); + ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev, NULL, + &ad7476_trigger_handler, NULL); if (ret) - goto error_disable_reg; + return ret; if (st->chip_info->reset) st->chip_info->reset(st); - ret = iio_device_register(indio_dev); - if (ret) - goto error_ring_unregister; - return 0; - -error_ring_unregister: - iio_triggered_buffer_cleanup(indio_dev); -error_disable_reg: - regulator_disable(st->reg); - - return ret; + return devm_iio_device_register(&spi->dev, indio_dev); } static const struct spi_device_id ad7476_id[] = { |