iio: adc: at91-sama5d2_adc: merge buffer & trigger init into a function
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Tue, 29 Sep 2020 12:59:42 +0000 (15:59 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Nov 2020 14:53:03 +0000 (14:53 +0000)
commit789976accb6a7b93226fcf8441ffc95edff3d371
tree24e7179823afb3083fd253a5b23a06e3d26cc395
parent5e6dc43e2caa145627d2de2b5a7c65545f3fb639
iio: adc: at91-sama5d2_adc: merge buffer & trigger init into a function

This change is mostly cosmetic, but it's also a pre-cursor to the
the change for 'iio_buffer_set_attrs()', where the helper gets updated to
better support multiple IIO buffers for 1 IIO device.

The only functional change is that the error message for the trigger alloc
failure is bound to the parent device vs the IIO device object.

Also, the new at91_adc_buffer_and_trigger_init() function was moved after
the definition of the 'at91_adc_fifo_attributes'.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-3-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/at91-sama5d2_adc.c