diff options
author | wkoszek <wkoszek@FreeBSD.org> | 2007-12-29 23:26:59 +0000 |
---|---|---|
committer | wkoszek <wkoszek@FreeBSD.org> | 2007-12-29 23:26:59 +0000 |
commit | bb029b61d9d00673b61ff3bd4589761e3ddbd060 (patch) | |
tree | 2208d9a465b1ecf2354401f83d3b431d9003169a /sys/isa | |
parent | 8a0ce839351386ec837779aa9f63b575cf8d096a (diff) | |
download | FreeBSD-src-bb029b61d9d00673b61ff3bd4589761e3ddbd060.zip FreeBSD-src-bb029b61d9d00673b61ff3bd4589761e3ddbd060.tar.gz |
Replace explicit calls to video methods with their respective variants
implemented with macros. This patch improves code readability. Reasoning
behind vidd_* is a sort of "video discipline".
List of macros is supposed to be complete--all methods of video_switch
ought to have their respective macros from now on.
Functionally, this code should be no-op. My intention is to leave current
behaviour of touched code as is.
No objections: rwatson
Silence on: freebsd-current@
Approved by: cognet
Diffstat (limited to 'sys/isa')
-rw-r--r-- | sys/isa/vga_isa.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/isa/vga_isa.c b/sys/isa/vga_isa.c index d69236d..3d7cd3a 100644 --- a/sys/isa/vga_isa.c +++ b/sys/isa/vga_isa.c @@ -150,7 +150,7 @@ isavga_attach(device_t dev) #endif /* FB_INSTALL_CDEV */ if (0 && bootverbose) - (*vidsw[sc->adp->va_index]->diag)(sc->adp, bootverbose); + vidd_diag(sc->adp, bootverbose); #if 0 /* experimental */ device_add_child(dev, "fb", -1); @@ -176,7 +176,7 @@ isavga_suspend(device_t dev) free(sc->state_buf, M_TEMP); sc->state_buf = NULL; } - nbytes = (*vidsw[sc->adp->va_index]->save_state)(sc->adp, NULL, 0); + nbytes = vidd_save_state(sc->adp, NULL, 0); if (nbytes <= 0) return (0); sc->state_buf = malloc(nbytes, M_TEMP, M_NOWAIT | M_ZERO); @@ -184,8 +184,7 @@ isavga_suspend(device_t dev) return (0); if (bootverbose) device_printf(dev, "saving %d bytes of video state\n", nbytes); - if ((*vidsw[sc->adp->va_index]->save_state)(sc->adp, sc->state_buf, - nbytes) != 0) { + if (vidd_save_state(sc->adp, sc->state_buf, nbytes) != 0) { device_printf(dev, "failed to save state (nbytes=%d)\n", nbytes); free(sc->state_buf, M_TEMP); @@ -201,8 +200,7 @@ isavga_resume(device_t dev) sc = device_get_softc(dev); if (sc->state_buf != NULL) { - if ((*vidsw[sc->adp->va_index]->load_state)(sc->adp, - sc->state_buf) != 0) + if (vidd_load_state(sc->adp, sc->state_buf) != 0) device_printf(dev, "failed to reload state\n"); free(sc->state_buf, M_TEMP); sc->state_buf = NULL; |