From: Nuno Sa <nuno.sa@xxxxxxxxxx> Simple helper for setting the buffer direction when it's allocated using iio_dmaengine_buffer_alloc(). Signed-off-by: Nuno Sa <nuno.sa@xxxxxxxxxx> --- drivers/iio/industrialio-buffer.c | 7 +++++++ include/linux/iio/buffer.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index 1d950a3e153b..4b1ca6ad86ee 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -1956,6 +1956,13 @@ void iio_buffer_put(struct iio_buffer *buffer) } EXPORT_SYMBOL_GPL(iio_buffer_put); +void iio_buffer_set_dir(struct iio_buffer *buffer, + enum iio_buffer_direction dir) +{ + buffer->direction = dir; +} +EXPORT_SYMBOL_GPL(iio_buffer_set_dir); + /** * iio_device_attach_buffer - Attach a buffer to a IIO device * @indio_dev: The device the buffer should be attached to diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h index 418b1307d3f2..7e70bb5adc01 100644 --- a/include/linux/iio/buffer.h +++ b/include/linux/iio/buffer.h @@ -55,4 +55,7 @@ bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev, int iio_device_attach_buffer(struct iio_dev *indio_dev, struct iio_buffer *buffer); +void iio_buffer_set_dir(struct iio_buffer *buffer, + enum iio_buffer_direction dir); + #endif /* _IIO_BUFFER_GENERIC_H_ */ -- 2.44.0