diff options
author | brian <brian@FreeBSD.org> | 2001-05-08 07:55:33 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-05-08 07:55:33 +0000 |
commit | b824fbe47c8163384ff2c1dac26ce3fdeab77aca (patch) | |
tree | f722856d174f6b63a19d395e52f942d645988342 /sys | |
parent | d8ef9cc3b5b9f5e2ab6ca2d6250d97259e791511 (diff) | |
download | FreeBSD-src-b824fbe47c8163384ff2c1dac26ce3fdeab77aca.zip FreeBSD-src-b824fbe47c8163384ff2c1dac26ce3fdeab77aca.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/digi/digi.c | 38 | ||||
-rw-r--r-- | sys/dev/digi/digi.h | 7 | ||||
-rw-r--r-- | sys/dev/digi/digi_isa.c | 5 | ||||
-rw-r--r-- | 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 1a9ca3f..75234d6 100644 --- a/sys/dev/digi/digi.c +++ b/sys/dev/digi/digi.c @@ -1,6 +1,8 @@ /*- * Copyright (c) 2001 Brian Somers <brian@Awfulhak.org> - * based on work by Slawa Olhovchenkov + * based on work by Slawa Olhovchenkov + * John Prince <johnp@knight-trosoft.com> + * Eric Hernes * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,46 +38,25 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/reboot.h> #include <sys/proc.h> #include <sys/conf.h> -#include <sys/dkstat.h> -#include <sys/file.h> #include <sys/linker.h> -#include <sys/uio.h> #include <sys/kernel.h> #include <sys/mbuf.h> #include <sys/malloc.h> -#include <sys/lock.h> -#include <sys/mutex.h> #include <sys/tty.h> #include <sys/syslog.h> - -#include <sys/types.h> #include <sys/fcntl.h> #include <sys/bus.h> - -#include <machine/clock.h> - #include <sys/bus.h> -#include <machine/bus.h> -#include <sys/rman.h> #include <machine/resource.h> -#include <vm/vm.h> -#include <vm/pmap.h> - -#include <pci/pcireg.h> -#include <pci/pcivar.h> - #include <dev/digi/digireg.h> #include <dev/digi/digiio.h> #include <dev/digi/digi.h> #include <dev/digi/digi_mod.h> #include <dev/digi/digi_pci.h> -#include <machine/ipl.h> - #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 f59f2af..b4ed14f 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 780aaf0..3d0bc87 100644 --- a/sys/dev/digi/digi_isa.c +++ b/sys/dev/digi/digi_isa.c @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001 Brian Somers <brian@Awfulhak.org> + * based on work by Slawa Olhovchenkov + * John Prince <johnp@knight-trosoft.com> + * Eric Hernes * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,11 +40,9 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/tty.h> -#include <sys/syslog.h> #include <sys/bus.h> #include <machine/bus.h> #include <sys/rman.h> -#include <sys/mutex.h> #include <machine/resource.h> #include <vm/vm.h> #include <vm/pmap.h> diff --git a/sys/dev/digi/digi_pci.c b/sys/dev/digi/digi_pci.c index cad061e..859f435 100644 --- a/sys/dev/digi/digi_pci.c +++ b/sys/dev/digi/digi_pci.c @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001 Brian Somers <brian@Awfulhak.org> + * based on work by Slawa Olhovchenkov + * John Prince <johnp@knight-trosoft.com> + * Eric Hernes * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,7 +34,6 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/tty.h> -#include <sys/syslog.h> #include <sys/bus.h> #include <machine/bus.h> #include <sys/rman.h> @@ -39,7 +41,6 @@ #include <vm/vm.h> #include <vm/pmap.h> #include <pci/pcivar.h> -#include <sys/mutex.h> #include <digi/digireg.h> #include <digi/digiio.h> @@ -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); |