Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Sep 2014 18:54:37 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r272124 - head/sys/pc98/cbus
Message-ID:  <201409251854.s8PIsbcA034205@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409251854.s8PIsbcA034205>