diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-10-30 13:26:30 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-10-30 13:26:30 +0000 |
commit | e85b7ddd2059a0c2c50ed85d3ae1f0446f060745 (patch) | |
tree | 622265c22c976c32ab4a66937d1c5659acfbfaa8 /sys | |
parent | 06688d9385f3c1632327af3169d6ac3adad2543d (diff) |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/powerpc64/dev/opalcons.c | 20 |
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) { |