Author: jhb
Date: Thu Sep 25 18:54:36 2014
New Revision: 272124
URL: http://svnweb.freebsd.org/changeset/base/272124

Log:
  Use callout(9) instead of timeout(9).
  
  Approved by:  nyan

Modified:
  head/sys/pc98/cbus/olpt.c

Modified: head/sys/pc98/cbus/olpt.c
==============================================================================
--- head/sys/pc98/cbus/olpt.c   Thu Sep 25 18:53:27 2014        (r272123)
+++ head/sys/pc98/cbus/olpt.c   Thu Sep 25 18:54:36 2014        (r272124)
@@ -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, in
        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;
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to