From 9f0974f96d84d1cd06e6f0f6c04d202198be4e51 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sun, 8 May 2005 20:25:09 +0000 Subject: [PATCH] In uart_cnprobe(), fill in the cn_name field of the consdev structure. The core console code checks this field when a console is added and emits a warning if it's empty. In practice the warning is harmless for uart(4), because the cn_name is filled in as soon as the device name is known; which is when the device is enumerated. To avoid the warning, to avoid possible complications caused by emitting the warning without there (possibly) being a console selected yet and to avoid complications when the UART isn't found during bus enumeration, we just preset the cn_name field here to the name of the driver. --- sys/dev/uart/uart_tty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/uart/uart_tty.c b/sys/dev/uart/uart_tty.c index 8f3c3c5d64f..6eb573be44f 100644 --- a/sys/dev/uart/uart_tty.c +++ b/sys/dev/uart/uart_tty.c @@ -76,6 +76,7 @@ uart_cnprobe(struct consdev *cp) if (uart_probe(&uart_console)) return; + strlcpy(cp->cn_name, uart_driver_name, sizeof(cp->cn_name)); cp->cn_pri = (boothowto & RB_SERIAL) ? CN_REMOTE : CN_NORMAL; cp->cn_arg = &uart_console; } -- 2.45.2