summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2020-10-30 13:26:29 +0000
committerkettenis <kettenis@openbsd.org>2020-10-30 13:26:29 +0000
commit86eeef6eda3ae6b33a0f8a0acdb0353eb35ed6d9 (patch)
tree47b72cd740c1ad529decf796e48b98161e7ac159
parentPromote section headers that can can be used unmodified as fragment (diff)
downloadwireguard-openbsd-86eeef6eda3ae6b33a0f8a0acdb0353eb35ed6d9.tar.xz
wireguard-openbsd-86eeef6eda3ae6b33a0f8a0acdb0353eb35ed6d9.zip
Add a comment that explains why the major/minor of the device is set
unconditionally now that astfb(4) can be used as the console as well. Only print that we're the console if we actually are.
-rw-r--r--sys/arch/powerpc64/dev/opalcons.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/arch/powerpc64/dev/opalcons.c b/sys/arch/powerpc64/dev/opalcons.c
index 9ac683d0ecd..ce628f75cd7 100644
--- a/sys/arch/powerpc64/dev/opalcons.c
+++ b/sys/arch/powerpc64/dev/opalcons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: opalcons.c,v 1.2 2020/06/26 19:13:28 kettenis Exp $ */
+/* $OpenBSD: opalcons.c,v 1.3 2020/10/30 13:26:29 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
*
@@ -74,15 +74,19 @@ opalcons_attach(struct device *parent, struct device *self, void *aux)
sc->sc_reg = OF_getpropint(faa->fa_node, "reg", 0);
- if (1) {
- /* Locate the major number. */
- for (maj = 0; maj < nchrdev; maj++)
- if (cdevsw[maj].d_open == opalconsopen)
- break;
- cn_tab->cn_dev = makedev(maj, self->dv_unit);
+ /* Locate the major number. */
+ for (maj = 0; maj < nchrdev; maj++)
+ if (cdevsw[maj].d_open == opalconsopen)
+ break;
+ /*
+ * Unconditionally set the major/minor here since we attach
+ * early and are the fallback console device
+ */
+ cn_tab->cn_dev = makedev(maj, self->dv_unit);
+
+ if (faa->fa_node == stdout_node)
printf(": console");
- }
sc->sc_si = softintr_establish(IPL_TTY, opalcons_softintr, sc);
if (sc->sc_si == NULL) {