]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
serdev: document driver callbacks
authorJohan Hovold <johan@kernel.org>
Fri, 3 Nov 2017 14:30:54 +0000 (15:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2017 15:03:35 +0000 (16:03 +0100)
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>
include/linux/serdev.h

index 9929063bd45db29ec00f1919cab0b27c0db9fe9b..d7a9713e98832e1d943188dab5f32591ada3b837 100644 (file)
@@ -27,8 +27,10 @@ struct serdev_device;
 
 /**
  * struct serdev_device_ops - Callback operations for a serdev device
- * @receive_buf:       Function called with data received from device.
- * @write_wakeup:      Function called when ready to transmit more data.
+ * @receive_buf:       Function called with data received from device;
+ *                     returns number of bytes accepted; may sleep.
+ * @write_wakeup:      Function called when ready to transmit more data; must
+ *                     not sleep.
  */
 struct serdev_device_ops {
        int (*receive_buf)(struct serdev_device *, const unsigned char *, size_t);