]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tty: introduce tty_port_tty guard()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Thu, 14 Aug 2025 07:24:42 +0000 (09:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Aug 2025 10:46:25 +0000 (12:46 +0200)
commite8398b8aed50382c21fcec77e80a5314e7c45c25
tree2278bf8efc51981365da39af6906b36a315528ae
parent4847d1187402a5027d9a04393f12d52a5a1d7f98
tty: introduce tty_port_tty guard()

Having this, guards like these work:
  scoped_guard(tty_port_tty, port)
    tty_wakeup(scoped_tty());

See e.g. "tty_port: use scoped_guard()" later in this series.

The definitions depend on CONFIG_TTY. It's due to tty_kref_put().
On !CONFIG_TTY, it is an inline and its declaration would conflict. The
guards are not needed in that case, of course.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20250814072456.182853-3-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/tty_port.h