diff options
| author | xtraeme <xtraeme@NetBSD.org> | 2008-04-01 13:35:39 +0000 |
|---|---|---|
| committer | xtraeme <xtraeme@NetBSD.org> | 2008-04-01 13:35:39 +0000 |
| commit | 8530f5047d2aaf6e4bcadea446bd6099c84b4258 (patch) | |
| tree | 45900befeec3b2f29fa9e5b6261136a4cf54c9cc /sys/dev | |
| parent | 5ee4eba88daa5874d8a4b2663c986fff47abe941 (diff) | |
Fix fallout from device_t/softc split to mpu(4):
always pass the mpu_softc to mpu_intr(). Found by Takeshi Nakayama.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/isa/mpu_isa.c | 6 | ||||
| -rw-r--r-- | sys/dev/pci/cmpci.c | 14 | ||||
| -rw-r--r-- | sys/dev/pci/eso.c | 14 | ||||
| -rw-r--r-- | sys/dev/pci/fms.c | 12 | ||||
| -rw-r--r-- | sys/dev/pci/yds.c | 14 |
5 files changed, 34 insertions, 26 deletions
diff --git a/sys/dev/isa/mpu_isa.c b/sys/dev/isa/mpu_isa.c index 5a39f8b7a3b..95e72f7d940 100644 --- a/sys/dev/isa/mpu_isa.c +++ b/sys/dev/isa/mpu_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: mpu_isa.c,v 1.18 2008/03/27 10:22:01 xtraeme Exp $ */ +/* $NetBSD: mpu_isa.c,v 1.19 2008/04/01 13:35:39 xtraeme Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mpu_isa.c,v 1.18 2008/03/27 10:22:01 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mpu_isa.c,v 1.19 2008/04/01 13:35:39 xtraeme Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -121,7 +121,7 @@ mpu_isa_attach(device_t parent, device_t self, void *aux) } sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq, - IST_EDGE, IPL_AUDIO, mpu_intr, sc); + IST_EDGE, IPL_AUDIO, mpu_intr, &sc->sc_mpu); sc->sc_mpu.model = "Roland MPU-401 MIDI UART"; sc->sc_dev = self; diff --git a/sys/dev/pci/cmpci.c b/sys/dev/pci/cmpci.c index 9dec927e3b5..e9b3f21a47b 100644 --- a/sys/dev/pci/cmpci.c +++ b/sys/dev/pci/cmpci.c @@ -1,4 +1,4 @@ -/* $NetBSD: cmpci.c,v 1.36 2007/10/19 12:00:41 ad Exp $ */ +/* $NetBSD: cmpci.c,v 1.37 2008/04/01 13:35:39 xtraeme Exp $ */ /* * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cmpci.c,v 1.36 2007/10/19 12:00:41 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cmpci.c,v 1.37 2008/04/01 13:35:39 xtraeme Exp $"); #if defined(AUDIO_DEBUG) || defined(DEBUG) #define DPRINTF(x) if (cmpcidebug) printf x @@ -524,10 +524,12 @@ cmpci_attach(struct device *parent, struct device *self, void *aux) static int cmpci_intr(void *handle) { - struct cmpci_softc *sc; + struct cmpci_softc *sc = handle; +#if NMPU > 0 + struct mpu_softc *sc_mpu = device_private(sc->sc_mpudev); +#endif uint32_t intrstat; - sc = handle; intrstat = bus_space_read_4(sc->sc_iot, sc->sc_ioh, CMPCI_REG_INTR_STATUS); @@ -562,8 +564,8 @@ cmpci_intr(void *handle) CMPCI_REG_CH1_INTR_ENABLE); #if NMPU > 0 - if (intrstat & CMPCI_REG_UART_INTR && sc->sc_mpudev != NULL) - mpu_intr(sc->sc_mpudev); + if (intrstat & CMPCI_REG_UART_INTR && sc_mpu != NULL) + mpu_intr(sc_mpu); #endif return 1; diff --git a/sys/dev/pci/eso.c b/sys/dev/pci/eso.c index f7b61c807ed..c1a4aa864cb 100644 --- a/sys/dev/pci/eso.c +++ b/sys/dev/pci/eso.c @@ -1,4 +1,4 @@ -/* $NetBSD: eso.c,v 1.51 2007/10/19 12:00:43 ad Exp $ */ +/* $NetBSD: eso.c,v 1.52 2008/04/01 13:35:39 xtraeme Exp $ */ /* * Copyright (c) 1999, 2000, 2004 Klaus J. Klein @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: eso.c,v 1.51 2007/10/19 12:00:43 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: eso.c,v 1.52 2008/04/01 13:35:39 xtraeme Exp $"); #include "mpu.h" @@ -566,10 +566,12 @@ eso_read_mixreg(struct eso_softc *sc, uint8_t reg) static int eso_intr(void *hdl) { - struct eso_softc *sc; + struct eso_softc *sc = hdl; +#if NMPU > 0 + struct mpu_softc *sc_mpu = device_private(sc->sc_mpudev); +#endif uint8_t irqctl; - sc = hdl; irqctl = bus_space_read_1(sc->sc_iot, sc->sc_ioh, ESO_IO_IRQCTL); /* If it wasn't ours, that's all she wrote. */ @@ -615,8 +617,8 @@ eso_intr(void *hdl) } #if NMPU > 0 - if ((irqctl & ESO_IO_IRQCTL_MPUIRQ) && sc->sc_mpudev != NULL) - mpu_intr(sc->sc_mpudev); + if ((irqctl & ESO_IO_IRQCTL_MPUIRQ) && sc_mpu != NULL) + mpu_intr(sc_mpu); #endif return 1; diff --git a/sys/dev/pci/fms.c b/sys/dev/pci/fms.c index 74fc983aeb3..1e5b110cc99 100644 --- a/sys/dev/pci/fms.c +++ b/sys/dev/pci/fms.c @@ -1,4 +1,4 @@ -/* $NetBSD: fms.c,v 1.30 2007/10/19 12:00:43 ad Exp $ */ +/* $NetBSD: fms.c,v 1.31 2008/04/01 13:35:39 xtraeme Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fms.c,v 1.30 2007/10/19 12:00:43 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fms.c,v 1.31 2008/04/01 13:35:39 xtraeme Exp $"); #include "mpu.h" @@ -421,10 +421,12 @@ fms_reset_codec(void *addr) static int fms_intr(void *arg) { - struct fms_softc *sc; + struct fms_softc *sc = arg; +#if NMPU > 0 + struct mpu_softc *sc_mpu = device_private(sc->sc_mpu_dev); +#endif uint16_t istat; - sc = arg; istat = bus_space_read_2(sc->sc_iot, sc->sc_ioh, FM_INTSTATUS); if (istat & FM_INTSTATUS_PLAY) { @@ -459,7 +461,7 @@ fms_intr(void *arg) #if NMPU > 0 if (istat & FM_INTSTATUS_MPU) - mpu_intr(sc->sc_mpu_dev); + mpu_intr(sc_mpu); #endif bus_space_write_2(sc->sc_iot, sc->sc_ioh, FM_INTSTATUS, diff --git a/sys/dev/pci/yds.c b/sys/dev/pci/yds.c index b1b60406098..c8bf049451a 100644 --- a/sys/dev/pci/yds.c +++ b/sys/dev/pci/yds.c @@ -1,4 +1,4 @@ -/* $NetBSD: yds.c,v 1.40 2008/02/29 06:13:39 dyoung Exp $ */ +/* $NetBSD: yds.c,v 1.41 2008/04/01 13:35:39 xtraeme Exp $ */ /* * Copyright (c) 2000, 2001 Kazuki Sakamoto and Minoura Makoto. @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: yds.c,v 1.40 2008/02/29 06:13:39 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: yds.c,v 1.41 2008/04/01 13:35:39 xtraeme Exp $"); #include "mpu.h" @@ -1015,16 +1015,18 @@ yds_reset_codec(void *sc_) static int yds_intr(void *p) { - struct yds_softc *sc; + struct yds_softc *sc = p; +#if NMPU > 0 + struct mpu_softc *sc_mpu = device_private(sc->sc_mpu); +#endif u_int status; - sc = p; status = YREAD4(sc, YDS_STATUS); DPRINTFN(1, ("yds_intr: status=%08x\n", status)); if ((status & (YDS_STAT_INT|YDS_STAT_TINT)) == 0) { #if NMPU > 0 - if (sc->sc_mpu) - return mpu_intr(sc->sc_mpu); + if (sc_mpu) + return mpu_intr(sc_mpu); #endif return 0; } |
