提交 6baee4bd 编写于 作者: J Jonathan Cameron

iio:adc:ad7476: Fix remove handling

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: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Fixes: 4bb2b8f9 ("iio: adc: ad7476: implement devm_add_action_or_reset")
Cc: Michael Hennerich <michael.hennerich@analog.com>
Reviewed-by: NAlexandru Ardelean <ardeleanalex@gmail.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210401171759.318140-2-jic23@kernel.org
上级 eaa17fa7
...@@ -321,25 +321,15 @@ static int ad7476_probe(struct spi_device *spi) ...@@ -321,25 +321,15 @@ static int ad7476_probe(struct spi_device *spi)
spi_message_init(&st->msg); spi_message_init(&st->msg);
spi_message_add_tail(&st->xfer, &st->msg); spi_message_add_tail(&st->xfer, &st->msg);
ret = iio_triggered_buffer_setup(indio_dev, NULL, ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev, NULL,
&ad7476_trigger_handler, NULL); &ad7476_trigger_handler, NULL);
if (ret) if (ret)
goto error_disable_reg; return ret;
if (st->chip_info->reset) if (st->chip_info->reset)
st->chip_info->reset(st); st->chip_info->reset(st);
ret = iio_device_register(indio_dev); return devm_iio_device_register(&spi->dev, 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;
} }
static const struct spi_device_id ad7476_id[] = { static const struct spi_device_id ad7476_id[] = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册