iio: adc: ti_am335x_adc: alloc kfifo & IRQ via devm_ functions
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Tue, 28 Apr 2020 11:14:29 +0000 (14:14 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 7 Jul 2020 19:24:11 +0000 (20:24 +0100)
commit3c5308058899fa1af7d55f457ef0189fb21e6365
tree7914124bdc4fb4f04fdcd0f2e4e69938c717f92e
parent6ff0199a1df2f65d708a36aed944c3c11ba198f6
iio: adc: ti_am335x_adc: alloc kfifo & IRQ via devm_ functions

This change attaches the life-cycle of the kfifo buffer & IRQ to the
parent-device. This in turn cleans up the exit & error paths, since we
don't need to explicitly cleanup these resources.

The main intent here is to remove the explicit cleanup of the
'indio_dev->buffer' via 'iio_kfifo_free(indio_dev->buffer);'.

As we want to add support for multiple buffers per IIO device, having it
exposed like this makes it tricky to consider a safe backwards compatible
approach for it.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ti_am335x_adc.c