summaryrefslogtreecommitdiff
path: root/include/linux/tty.h
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2021-04-09 10:35:12 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-10 11:40:00 +0300
commit86b20677e8b657c8c9701edd907f356795e9e427 (patch)
tree6ce401d37bff5c0925ddf62a5a0d3d4ef4f501c6 /include/linux/tty.h
parent9e5313acadfc0a28a227ff72b5c300b26925ff86 (diff)
downloadlinux-86b20677e8b657c8c9701edd907f356795e9e427.tar.xz
tty: clarify that not all ttys have a class device
Commit 30004ac9c090 ("tty: add tty_struct->dev pointer to corresponding device instance") added a struct device pointer field to struct tty_struct which was populated with the corresponding tty class device during initialisation. Unfortunately, not all ttys have a class device (e.g. pseudoterminals and serdev) in which case the device pointer will be set to NULL, something which have bit driver authors over the years. In retrospect perhaps this field should never have been added, but let's at least document the current behaviour. Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20210409073512.6876-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 51f56e5ec955..a228c0ee484f 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -284,7 +284,7 @@ struct tty_operations;
struct tty_struct {
int magic;
struct kref kref;
- struct device *dev;
+ struct device *dev; /* class device or NULL (e.g. ptys, serdev) */
struct tty_driver *driver;
const struct tty_operations *ops;
int index;