]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tty: srmcons: fix retval from srmcons_init()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Mon, 17 Mar 2025 07:00:36 +0000 (08:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Mar 2025 15:00:51 +0000 (08:00 -0700)
commit528f31191ebaa00d4a99b293eef1d16f604a0bd0
tree0d94231b7f76201d1254035f520b58cbb59ec15e
parent794d7b2721016b81f01838b0ff6eeb18bcfe6fcd
tty: srmcons: fix retval from srmcons_init()

The value returned from srmcons_init() was -ENODEV for over 2 decades.
But it does not matter, given device_initcall() ignores retvals.

But to be honest, return 0 in case the tty driver was registered
properly.

To do that, the condition is inverted and a short path taken in case of
error.

err_free_drv is introduced as it will be used from more places later.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Tested-by: Magnus Lindholm <linmag7@gmail.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Matt Turner <mattst88@gmail.com>
Cc: linux-alpha@vger.kernel.org
Link: https://lore.kernel.org/r/20250317070046.24386-22-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/alpha/kernel/srmcons.c