Commit 86b20677 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

tty: clarify that not all ttys have a class device

Commit 30004ac9 ("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: default avatarJohan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210409073512.6876-1-johan@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9e5313ac
...@@ -284,7 +284,7 @@ struct tty_operations; ...@@ -284,7 +284,7 @@ struct tty_operations;
struct tty_struct { struct tty_struct {
int magic; int magic;
struct kref kref; struct kref kref;
struct device *dev; struct device *dev; /* class device or NULL (e.g. ptys, serdev) */
struct tty_driver *driver; struct tty_driver *driver;
const struct tty_operations *ops; const struct tty_operations *ops;
int index; int index;
......
Markdown is supported
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