]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
serial: 8250: invert serial8250_register_8250_port() CIR condition
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Wed, 11 Jun 2025 10:03:16 +0000 (12:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Jun 2025 11:42:36 +0000 (13:42 +0200)
commit05b537a175442c530593013ea31b3f48d5624916
tree26259db2c006d96c5afdd83384f73b88d38726dc
parent15c9dc7353efd86346c692d049e4ca3b228358b8
serial: 8250: invert serial8250_register_8250_port() CIR condition

There is no point in a long 'if' in serial8250_register_8250_port() to
just return ENOSPC for PORT_8250_CIR ports. Invert the condition and
return immediately.

'gpios' variable was moved to its set location.

And return ENODEV instead of ENOSPC. The latter is a leftover from the
previous find-uart 'if'. The former makes a lot more sense in this case.

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/20250611100319.186924-31-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_core.c