]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
serial: add PORT_GENERIC definition
authorMax Filippov <jcmvbkbc@gmail.com>
Sun, 8 Oct 2023 00:18:04 +0000 (17:18 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Oct 2023 06:51:10 +0000 (08:51 +0200)
Current pattern in the linux kernel is that every new serial driver adds
one or more new PORT_ definitions because uart_ops::config_port()
callback documentation prescribes setting port->type according to the
type of port found, or to PORT_UNKNOWN if no port was detected.

When the specific type of the port is not important to the userspace
there's no need for a unique PORT_ value, but so far there's no suitable
identifier for that case.

Provide generic port type identifier other than PORT_UNKNOWN for ports
which type is not important to userspace.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Suggested-by: Jiri Slaby <jirislaby@kernel.org>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20231008001804.889727-1-jcmvbkbc@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/uapi/linux/serial_core.h

index 46e06c4838999464d17c5901d59bb3e2043a06c6..9c007a106330b90b92cbcf60a9ac806b290d6d44 100644 (file)
 /* Sunplus UART */
 #define PORT_SUNPLUS   123
 
+/* Generic type identifier for ports which type is not important to userspace. */
+#define PORT_GENERIC   (-1)
+
 #endif /* _UAPILINUX_SERIAL_CORE_H */