summaryrefslogtreecommitdiffstats
path: root/sys/dev/ofw/ofw_console.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ofw/ofw_console.c')
-rw-r--r--sys/dev/ofw/ofw_console.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c
index e71d5c1..01f86bf 100644
--- a/sys/dev/ofw/ofw_console.c
+++ b/sys/dev/ofw/ofw_console.c
@@ -88,17 +88,19 @@ cn_drvinit(void *unused)
if (ofw_consdev.cn_pri != CN_DEAD &&
ofw_consdev.cn_name[0] != '\0') {
- if ((options = OF_finddevice("/options")) == -1 ||
- OF_getprop(options, "output-device", output,
- sizeof(output)) == -1)
- return;
+ tp = tty_alloc(&ofw_ttydevsw, NULL);
+ tty_makedev(tp, NULL, "%s", "ofwcons");
+
/*
* XXX: This is a hack and it may result in two /dev/ttya
* XXX: devices on platforms where the sab driver works.
*/
- tp = tty_alloc(&ofw_ttydevsw, NULL);
- tty_makedev(tp, NULL, "%s", output);
- tty_makealias(tp, "ofwcons");
+ if ((options = OF_finddevice("/options")) == -1 ||
+ OF_getprop(options, "output-device", output,
+ sizeof(output)) == -1)
+ return;
+ if (strlen(output) > 0)
+ tty_makealias(tp, output);
}
}
OpenPOWER on IntegriCloud