Skip to content
Commit 17395ce2 authored by Alexandru Ardelean's avatar Alexandru Ardelean Committed by Jonathan Cameron
Browse files

iio: make use of devm_iio_kfifo_buffer_setup() helper



All drivers that already call devm_iio_kfifo_allocate() &
iio_device_attach_buffer() are simple to convert to
iio_device_attach_kfifo_buffer() in a single go.

This change does that; the unwind order is preserved.
What is important, is that the devm_iio_kfifo_buffer_setup() be called
after the indio_dev->modes is assigned, to make sure that
INDIO_BUFFER_SOFTWARE flag is set and not overridden by the assignment to
indio_dev->modes.

Also, the INDIO_BUFFER_SOFTWARE has been removed from the assignments of
'indio_dev->modes' because it is set by devm_iio_kfifo_buffer_setup().

Signed-off-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: default avatarGwendal Grignou <gwendal@chromium.org>
Reviewed-by: default avatarMatt Ranostay <matt.ranostay@konsulko.com&gt;x>
Link: https://lore.kernel.org/r/20210215104043.91251-4-alexandru.ardelean@analog.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent e36db6a0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment