linux-stable/drivers/iio/buffer
Alexandru Ardelean 5164c78898 iio: triggered-buffer: add {devm_}iio_triggered_buffer_setup_ext variants
This change adds a parameter to the {devm_}iio_triggered_buffer_setup()
functions to assign the extra sysfs buffer attributes that are typically
assigned via iio_buffer_set_attrs().

The functions also get renamed to iio_triggered_buffer_setup_ext() &
devm_iio_triggered_buffer_setup_ext().
For backwards compatibility the old {devm_}iio_triggered_buffer_setup()
functions are now macros wrap the new (renamed) functions with NULL for the
buffer attrs.

The aim is to remove iio_buffer_set_attrs(), so in the
iio_triggered_buffer_setup_ext() function the attributes are assigned
directly to 'buffer->attrs'.

When adding multiple IIO buffers per IIO device, it can be pretty
cumbersome to first allocate a set of buffers, then to dig them out of IIO
to assign extra attributes (with iio_buffer_set_attrs()).

Naturally, the best way would be to provide them at allocation time, which
is what this change does.

At this moment, buffers allocated with {devm_}iio_triggered_buffer_setup()
are the only ones in mainline IIO to call iio_buffer_set_attrs().

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-4-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-11-21 14:53:09 +00:00
..
industrialio-buffer-cb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
industrialio-buffer-dma.c iio: dma-buffer: Cleanup buffer.h/buffer_impl.h includes 2020-04-19 16:56:31 +01:00
industrialio-buffer-dmaengine.c iio: buffer: dmaengine: unwrap the use of iio_buffer_set_attrs() 2020-11-21 14:52:57 +00:00
industrialio-hw-consumer.c iio: buffer: drop devm_iio_hw_consumer_free() API call 2020-04-19 16:56:37 +01:00
industrialio-triggered-buffer.c iio: triggered-buffer: add {devm_}iio_triggered_buffer_setup_ext variants 2020-11-21 14:53:09 +00:00
Kconfig iio: buffer: Kconfig: add title for IIO_TRIGGERED_BUFFER symbol 2020-09-29 17:27:08 +01:00
kfifo_buf.c iio: buffer: drop devm_iio_kfifo_free() API call 2020-04-19 16:56:38 +01:00
Makefile iio: Add hardware consumer buffer support 2018-01-10 10:30:05 +00:00