aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-11-03 10:30:54 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-11-28 10:03:35 -0500
commit10f9e033c1e0e8563699b5839a2ff7f565dd72b2 (patch)
tree32b207d27a797ece816a7a02821335eadcd62d2c
parent1f043572cbbee03f1de814e312f9dc11251fdc5a (diff)
serdev: document driver callbacks
Amend the driver-callback kerneldoc with calling context and expected return values. Note that this is based on the requirements and characteristics of the tty-port controller implementation which receives data in workqueue context and whose write_wakeup callback must not sleep. Also note that while the receive_buf callback returns an integer, the returned value is still expected to be non-negative (and no greater than the buffer-size argument). Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--include/linux/serdev.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index 9929063bd45d..d7a9713e9883 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -27,8 +27,10 @@ struct serdev_device;
27 27
28/** 28/**
29 * struct serdev_device_ops - Callback operations for a serdev device 29 * struct serdev_device_ops - Callback operations for a serdev device
30 * @receive_buf: Function called with data received from device. 30 * @receive_buf: Function called with data received from device;
31 * @write_wakeup: Function called when ready to transmit more data. 31 * returns number of bytes accepted; may sleep.
32 * @write_wakeup: Function called when ready to transmit more data; must
33 * not sleep.
32 */ 34 */
33struct serdev_device_ops { 35struct serdev_device_ops {
34 int (*receive_buf)(struct serdev_device *, const unsigned char *, size_t); 36 int (*receive_buf)(struct serdev_device *, const unsigned char *, size_t);