aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Filippov <[email protected]>2023-10-07 17:18:04 -0700
committerGreg Kroah-Hartman <[email protected]>2023-10-10 08:51:10 +0200
commitc7c5be58620a3b1e5fbaf4daea59f2eb6f8fe034 (patch)
treec505ec392f1ae6694385978de1230fcc7e0db7c1
parent3047b5b53c36c2cb7874d3823320ffff6a8bf6b3 (diff)
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 <[email protected]> Suggested-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Max Filippov <[email protected]> Suggested-by: Jiri Slaby <[email protected]> Reviewed-by: Jiri Slaby <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--include/uapi/linux/serial_core.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h
index 46e06c483899..9c007a106330 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 */