]> git.baikalelectronics.ru Git - kernel.git/commit
tty: clarify that not all ttys have a class device
authorJohan Hovold <johan@kernel.org>
Fri, 9 Apr 2021 07:35:12 +0000 (09:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Apr 2021 08:40:00 +0000 (10:40 +0200)
commit67a9a189511dec61a774ea97c2f9b30ea0a6d8b3
tree6ce401d37bff5c0925ddf62a5a0d3d4ef4f501c6
parentea40dc9fcc8f6288e1a64369d1476b8cd0e174e1
tty: clarify that not all ttys have a class device

Commit cb419364fd17 ("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>
include/linux/tty.h