summaryrefslogtreecommitdiff
path: root/sys/dev/ppbus
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2005-04-14 15:56:10 +0000
committerWarner Losh <imp@FreeBSD.org>2005-04-14 15:56:10 +0000
commit3aabc1594177ad692b60bea83ffc4d3e99b2dcef (patch)
tree30bfa717c389db87975a63c122f10ca0ed88cebf /sys/dev/ppbus
parentf3f148d238851e68b0ec00daca83c0c0dec7ee03 (diff)
Notes
Diffstat (limited to 'sys/dev/ppbus')
-rw-r--r--sys/dev/ppbus/pps.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/dev/ppbus/pps.c b/sys/dev/ppbus/pps.c
index e5c2afd3bdbe..7a14fd14f698 100644
--- a/sys/dev/ppbus/pps.c
+++ b/sys/dev/ppbus/pps.c
@@ -206,7 +206,7 @@ ppsopen(struct cdev *dev, int flags, int fmt, struct thread *td)
/* attach the interrupt handler */
if ((error = bus_setup_intr(ppsdev, sc->intr_resource,
(INTR_TYPE_TTY | INTR_MPSAFE | INTR_FAST), ppsintr,
- ppsdev, &sc->intr_cookie))) {
+ sc, &sc->intr_cookie))) {
ppb_release_bus(ppbus, ppsdev);
return (error);
}
@@ -279,22 +279,18 @@ ppshcpoll(void *arg)
static void
ppsintr(void *arg)
{
- device_t ppsdev = (device_t)arg;
- struct pps_data *sc = DEVTOSOFTC(ppsdev);
- device_t ppbus = sc->ppbus;
+ struct pps_data *sc = (struct pps_data *)arg;
- mtx_lock_spin(&sc->mtx);
pps_capture(&sc->pps[0]);
- if (!(ppb_rstr(ppbus) & nACK)) {
- mtx_unlock_spin(&sc->mtx);
+ if (!(ppb_rstr(sc->ppbus) & nACK))
return;
- }
if (sc->pps[0].ppsparam.mode & PPS_ECHOASSERT)
- ppb_wctr(ppbus, IRQENABLE | AUTOFEED);
+ ppb_wctr(sc->ppbus, IRQENABLE | AUTOFEED);
+ mtx_lock_spin(&sc->mtx);
pps_event(&sc->pps[0], PPS_CAPTUREASSERT);
- if (sc->pps[0].ppsparam.mode & PPS_ECHOASSERT)
- ppb_wctr(ppbus, IRQENABLE);
mtx_unlock_spin(&sc->mtx);
+ if (sc->pps[0].ppsparam.mode & PPS_ECHOASSERT)
+ ppb_wctr(sc->ppbus, IRQENABLE);
}
static int