From f80704eff1104aa3f2ede452682d8433da75ca3f Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Tue, 8 May 2001 07:55:33 +0000 Subject: [PATCH] Remove all the mutex stuff - suggested by jhb Tidy up includes, credit Slawa Olhovchenkov, John Prince and Eric Hernes for their efforts and add a couple of missing parenthesis around return expressions. --- sys/dev/digi/digi.c | 38 +++----------------------------------- sys/dev/digi/digi.h | 7 ------- sys/dev/digi/digi_isa.c | 5 +++-- sys/dev/digi/digi_pci.c | 11 ++++++----- 4 files changed, 12 insertions(+), 49 deletions(-) diff --git a/sys/dev/digi/digi.c b/sys/dev/digi/digi.c index 1a9ca3f1543..75234d6cbaf 100644 --- a/sys/dev/digi/digi.c +++ b/sys/dev/digi/digi.c @@ -1,6 +1,8 @@ /*- * Copyright (c) 2001 Brian Somers - * based on work by Slawa Olhovchenkov + * based on work by Slawa Olhovchenkov + * John Prince + * Eric Hernes * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,46 +38,25 @@ #include #include -#include #include #include -#include -#include #include -#include #include #include #include -#include -#include #include #include - -#include #include #include - -#include - #include -#include -#include #include -#include -#include - -#include -#include - #include #include #include #include #include -#include - #define CDEV_MAJOR 162 #define CTRL_DEV 0x800000 @@ -674,9 +655,6 @@ digi_init(struct digi_softc *sc) } sc->hidewin(sc); -#ifdef DIGI_LOCK_INTR - mtx_init(sc->intr_mutex, "digi interrupt mutex", MTX_DEF); -#endif sc->inttest = timeout(digi_int_test, sc, hz); /* fepcmd_w(&sc->ports[0], 0xff, 0, 0); */ sc->status = DIGI_STATUS_ENABLED; @@ -1457,10 +1435,6 @@ digi_intr(void *vp) return; } -#ifdef DIGI_LOCK_INTR - mtx_lock(sc->intr_mutex); -#endif - #ifdef DIGI_INTERRUPT microtime(&sc->intr_timestamp); #endif @@ -1660,9 +1634,6 @@ eoi: sc->towin(sc, 0); if (window != 0) sc->towin(sc, window); -#ifdef DIGI_LOCK_INTR - mtx_unlock(sc->intr_mutex); -#endif } static void @@ -1868,9 +1839,6 @@ digi_free_state(struct digi_softc *sc) callout_handle_init(&sc->inttest); bus_teardown_intr(sc->dev, sc->res.irq, sc->res.irqHandler); -#ifdef DIGI_LOCK_INTR - mtx_destroy(sc->intr_mutex); -#endif #ifdef DIGI_INTERRUPT if (sc->res.irq != NULL) { bus_release_resource(dev, SYS_RES_IRQ, sc->res.irqrid, diff --git a/sys/dev/digi/digi.h b/sys/dev/digi/digi.h index f59f2af3e16..b4ed14fd7cc 100644 --- a/sys/dev/digi/digi.h +++ b/sys/dev/digi/digi.h @@ -37,10 +37,6 @@ #define CE_NTYPES 3 #define CE_RECORD(com, errnum) (++(com)->delta_error_counts[errnum]) -#ifdef SMP -#define DIGI_LOCK_INTR -#endif - /*#define DIGI_INTERRUPT*/ #ifndef DEBUG @@ -196,9 +192,6 @@ struct digi_softc { u_char *(*setwin)(struct digi_softc *_sc, unsigned _addr); void (*hidewin)(struct digi_softc *_sc); void (*towin)(struct digi_softc *_sc, int _win); -#ifdef DIGI_LOCK_INTR - struct mtx intr_mutex[1]; -#endif #ifdef DEBUG int intr_count; #endif diff --git a/sys/dev/digi/digi_isa.c b/sys/dev/digi/digi_isa.c index 780aaf0226b..3d0bc877854 100644 --- a/sys/dev/digi/digi_isa.c +++ b/sys/dev/digi/digi_isa.c @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001 Brian Somers + * based on work by Slawa Olhovchenkov + * John Prince + * Eric Hernes * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,11 +40,9 @@ #include #include #include -#include #include #include #include -#include #include #include #include diff --git a/sys/dev/digi/digi_pci.c b/sys/dev/digi/digi_pci.c index cad061e172b..859f43506b0 100644 --- a/sys/dev/digi/digi_pci.c +++ b/sys/dev/digi/digi_pci.c @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001 Brian Somers + * based on work by Slawa Olhovchenkov + * John Prince + * Eric Hernes * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -39,7 +41,6 @@ #include #include #include -#include #include #include @@ -88,10 +89,10 @@ digi_pci_probe(device_t dev) case PCI_DEVICE_920_4: case PCI_DEVICE_920_8: case PCI_DEVICE_920_2: - return 0; + return (0); } - return ENXIO; + return (ENXIO); } static int @@ -184,7 +185,7 @@ digi_pci_attach(device_t dev) 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); if (sc->res.irq == NULL) { device_printf(dev, "couldn't map interrupt\n"); - return ENXIO; + return (ENXIO); } retVal = bus_setup_intr(dev, sc->res.irq, INTR_TYPE_TTY, digiintr, sc, &sc->res.irqHandler);