Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: buffer: document that buffer callback must be context safe

Document that the callback registered with iio_channel_get_all_cb()
must be safe to call from any context since it is called from by
iio_push_to_buffer() which can be called in any context.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
592ae0cc 748ed9fc

+3 -1
+1
drivers/iio/buffer/industrialio-buffer-cb.c
··· 13 13 14 14 struct iio_cb_buffer { 15 15 struct iio_buffer buffer; 16 + /* Must be safe to call from any context (e.g. must not sleep). */ 16 17 int (*cb)(const void *data, void *private); 17 18 void *private; 18 19 struct iio_channel *channels;
+2 -1
include/linux/iio/consumer.h
··· 131 131 /** 132 132 * iio_channel_get_all_cb() - register callback for triggered capture 133 133 * @dev: Pointer to client device. 134 - * @cb: Callback function. 134 + * @cb: Callback function. Must be safe to call from any context 135 + * (e.g. must not sleep). 135 136 * @private: Private data passed to callback. 136 137 * 137 138 * NB right now we have no ability to mux data from multiple devices.