Skip to content

Commit c7c5be5

Browse files
jcmvbkbcgregkh
authored andcommitted
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]>
1 parent 3047b5b commit c7c5be5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/uapi/linux/serial_core.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,4 +231,7 @@
231231
/* Sunplus UART */
232232
#define PORT_SUNPLUS 123
233233

234+
/* Generic type identifier for ports which type is not important to userspace. */
235+
#define PORT_GENERIC (-1)
236+
234237
#endif /* _UAPILINUX_SERIAL_CORE_H */

0 commit comments

Comments
 (0)