From 13ed998024a6abd18bc9cb60d04c38eced185ca8 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Sun, 25 Mar 2001 11:54:01 +0000 Subject: Repair timeouts. kern/1743, but with simpler fix --- sys/dev/ic/cy.c | 10 ++++++---- sys/dev/ic/cyreg.h | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'sys') diff --git a/sys/dev/ic/cy.c b/sys/dev/ic/cy.c index 6e3d2b42b50..6050f7502ed 100644 --- a/sys/dev/ic/cy.c +++ b/sys/dev/ic/cy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cy.c,v 1.11 2001/02/03 06:33:37 mickey Exp $ */ +/* $OpenBSD: cy.c,v 1.12 2001/03/25 11:54:00 art Exp $ */ /* * cy.c @@ -87,6 +87,7 @@ static bus_space_handle_t cy_card_memh[NCY]; static int cy_open = 0; static int cy_events = 0; +struct timeout cy_poll_to; /* * Common probe routine @@ -224,7 +225,8 @@ cyattach(parent, self, aux) #endif } - timeout_set(&sc->sc_tmo, cy_poll, NULL); + if (!timeout_initialized(&cy_poll_to)) + timeout_set(&cy_poll_to, cy_poll, NULL); bzero(sc->sc_ports, sizeof(sc->sc_ports)); sc->sc_nports = num_chips * CD1400_NO_OF_CHANNELS; @@ -409,7 +411,7 @@ cyopen(dev, flag, mode, p) if(cy_open == 0) { cy_open = 1; - timeout_add(&sc->sc_tmo, 1); + timeout_add(&cy_poll_to, 1); } /* this sets parameters and raises DTR */ @@ -1151,7 +1153,7 @@ cy_poll(arg) counter = 0; out: - timeout_add(&sc->sc_tmo, 1); + timeout_add(&cy_poll_to, 1); } /* diff --git a/sys/dev/ic/cyreg.h b/sys/dev/ic/cyreg.h index 06261319bc6..a364c8a8610 100644 --- a/sys/dev/ic/cyreg.h +++ b/sys/dev/ic/cyreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cyreg.h,v 1.4 2001/02/03 06:33:37 mickey Exp $ */ +/* $OpenBSD: cyreg.h,v 1.5 2001/03/25 11:54:00 art Exp $ */ /* $FreeBSD: cyreg.h,v 1.1 1995/07/05 12:15:51 bde Exp $ */ /*- @@ -162,7 +162,6 @@ struct cy_port { struct cy_softc { struct device sc_dev; void *sc_ih; - struct timeout sc_tmo; bus_space_tag_t sc_memt; bus_space_handle_t sc_memh; int sc_bustype; -- cgit v1.2.3