Use callout(9) instead of timeout(9).

Approved by:	nyan
This commit is contained in:
jhb 2014-09-25 18:54:36 +00:00
parent 98e5bb3d6c
commit 1cafd48c74

View File

@ -140,6 +140,7 @@ struct lpt_softc {
struct resource *res_port;
struct resource *res_irq;
void *sc_ih;
struct callout timer;
int sc_port;
short sc_state;
@ -319,6 +320,7 @@ lpt_attach(device_t dev)
unit = device_get_unit(dev);
sc = device_get_softc(dev);
callout_init(&sc->timer, 0);
rid = 0;
sc->res_port = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &rid,
@ -418,8 +420,8 @@ lptopen (struct cdev *dev, int flags, int fmt, struct thread *td)
lprintf(("irq %x\n", sc->sc_irq));
if (sc->sc_irq & LP_USE_IRQ) {
sc->sc_state |= TOUT;
timeout (lptout, (caddr_t)sc,
(sc->sc_backoff = hz/LPTOUTINITIAL));
sc->sc_backoff = hz / LPTOUTINITIAL;;
callout_reset(&sc->timer, sc->sc_backoff, lptout, sc);
}
lprintf(("opened.\n"));
@ -437,7 +439,7 @@ lptout (void *arg)
sc->sc_backoff++;
if (sc->sc_backoff > hz/LPTOUTMAX)
sc->sc_backoff = sc->sc_backoff > hz/LPTOUTMAX;
timeout (lptout, (caddr_t)sc, sc->sc_backoff);
callout_reset(&sc->timer, sc->sc_backoff, lptout, sc);
} else
sc->sc_state &= ~TOUT;