Date: Mon, 15 Aug 2016 20:17:48 +0000 (UTC) From: Bruce Evans <bde@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304186 - head/sys/dev/syscons Message-ID: <201608152017.u7FKHmwG018812@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bde Date: Mon Aug 15 20:17:48 2016 New Revision: 304186 URL: https://svnweb.freebsd.org/changeset/base/304186 Log: Clean up the new sc cn open and close functions (old sc cn grab and ungrab functions). Mainly, spell sc as itself instead of as scp->sc. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 20:11:52 2016 (r304185) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 20:17:48 2016 (r304186) @@ -1652,46 +1652,40 @@ static void sccnopen(sc_softc_t *sc, str static void sccnopen(sc_softc_t *sc, struct sc_cnstate *sp, int flags) { - scr_stat *scp; int kbd_mode; if (!cold && - sc_console->sc->cur_scp->index != sc_console->index && - sc_console->sc->cur_scp->smode.mode == VT_AUTO && + sc->cur_scp->index != sc_console->index && + sc->cur_scp->smode.mode == VT_AUTO && sc_console->smode.mode == VT_AUTO) - sc_switch_scr(sc_console->sc, sc_console->index); - - scp = sc_console->sc->cur_scp; + sc_switch_scr(sc, sc_console->index); - if (scp->sc->kbd == NULL) + if (sc->kbd == NULL) return; /* * Make sure the keyboard is accessible even when the kbd device * driver is disabled. */ - kbdd_enable(scp->sc->kbd); + kbdd_enable(sc->kbd); /* Switch the keyboard to console mode (K_XLATE, polled) on all scp's. */ kbd_mode = K_XLATE; - (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&kbd_mode); - kbdd_poll(scp->sc->kbd, TRUE); + (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&kbd_mode); + kbdd_poll(sc->kbd, TRUE); } static void sccnclose(sc_softc_t *sc, struct sc_cnstate *sp) { - scr_stat *scp; - - scp = sc_console->sc->cur_scp; /* XXX */ - if (scp->sc->kbd == NULL) + if (sc->kbd == NULL) return; /* Restore keyboard mode (for the current, possibly-changed scp). */ - kbdd_poll(scp->sc->kbd, FALSE); - (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + kbdd_poll(sc->kbd, FALSE); + (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&sc->cur_scp->kbd_mode); - kbdd_disable(scp->sc->kbd); + kbdd_disable(sc->kbd); } static void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608152017.u7FKHmwG018812>