On 11. 06. 25, 13:13, Ilpo Järvinen wrote:
On Wed, 11 Jun 2025, Jiri Slaby (SUSE) wrote:
This code (tty_get -> vhangup -> tty_put) is repeated on few places. Introduce a helper similar to tty_port_tty_hangup() (asynchronous) to handle even vhangup (synchronous).
And use it on those places.
In fact, reuse the tty_port_tty_hangup()'s code and call tty_vhangup() depending on a new bool parameter.
Signed-off-by: Jiri Slaby (SUSE) jirislaby@kernel.org Cc: Karsten Keil isdn@linux-pingi.de Cc: David Lin dtwlin@gmail.com Cc: Johan Hovold johan@kernel.org Cc: Alex Elder elder@kernel.org Cc: Oliver Neukum oneukum@suse.com Cc: Marcel Holtmann marcel@holtmann.org Cc: Johan Hedberg johan.hedberg@gmail.com Cc: Luiz Augusto von Dentz luiz.dentz@gmail.com
Nice cleanup. I'm not sure if it's important enough to be mentioned in Documentation/driver-api/tty/tty_port.rst .
At minimum I broke tty_port_tty_hangup()'s kernel-doc: /** * tty_port_tty_hangup - helper to hang up a tty * @port: tty port * @check_clocal: hang only ttys with %CLOCAL unset? */ void __tty_port_tty_hangup(struct tty_port *port, bool check_clocal, bool async)
doc says tty_port_tty_hangup(), code says __tty_port_tty_hangup(). Fix coming, incl. vhangup addition.
thanks,