From: Max Filippov Date: Sun, 8 Oct 2023 00:18:04 +0000 (-0700) Subject: serial: add PORT_GENERIC definition X-Git-Tag: v6.7-rc1~75^2~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c7c5be58620a3b1e5fbaf4daea59f2eb6f8fe034;p=thirdparty%2Flinux.git serial: add PORT_GENERIC definition 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 Suggested-by: Greg Kroah-Hartman Signed-off-by: Max Filippov Suggested-by: Jiri Slaby Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/20231008001804.889727-1-jcmvbkbc@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h index 46e06c4838999..9c007a106330b 100644 --- a/include/uapi/linux/serial_core.h +++ b/include/uapi/linux/serial_core.h @@ -231,4 +231,7 @@ /* 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 */