summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2005-05-08 20:25:09 +0000
committermarcel <marcel@FreeBSD.org>2005-05-08 20:25:09 +0000
commit0721647aabc2bc02b364fa893d0c9ab0fb2e29cc (patch)
tree3d5ec877ef2a4e434b2d57fb4524308b4bc18ffe /sys/dev/uart
parent942b7e7d55f566a72bbc49d6a57ee6b32d0b98da (diff)
downloadFreeBSD-src-0721647aabc2bc02b364fa893d0c9ab0fb2e29cc.zip
FreeBSD-src-0721647aabc2bc02b364fa893d0c9ab0fb2e29cc.tar.gz
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.
Diffstat (limited to 'sys/dev/uart')
-rw-r--r--sys/dev/uart/uart_tty.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/dev/uart/uart_tty.c b/sys/dev/uart/uart_tty.c
index 8f3c3c5..6eb573b 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;
}
OpenPOWER on IntegriCloud