]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tty: simplify tty_dev_name_to_number() using guard(mutex)
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Mon, 5 Aug 2024 10:20:34 +0000 (12:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Aug 2024 11:13:35 +0000 (13:13 +0200)
commit8173dbc18f7762de5b1a5a9960e09d303f766c4b
tree2e48370fc6bc7e9610afffa98eb1cb191f394d00
parent3a2a3437dc2eeff5d8f1263537d738d2f3b2a8f0
tty: simplify tty_dev_name_to_number() using guard(mutex)

In tty_dev_name_to_number(), a guard can help to make the code easier to
follow. Especially how 0 is returned in the successful case. So use a
guard there.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240805102046.307511-2-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_io.c