Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/dev



On Sun, 30 Mar 2008 02:44:51 +0900 (JST)
Takeshi Nakayama <tn%catvmics.ne.jp@localhost> wrote:

> For instance, mpu_intr() argument in sys/dev/pci/yds.c is
> sc->sc_mpu and its type is struct device_t *.

Thanks for catching this. Would the following patch be ok?

Index: ic/mpu.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/mpu.c,v
retrieving revision 1.16
diff -b -u -p -r1.16 mpu.c
--- ic/mpu.c    27 Mar 2008 10:22:01 -0000      1.16
+++ ic/mpu.c    29 Mar 2008 18:15:37 -0000
@@ -250,7 +250,7 @@ mpu_getinfo(void *addr, struct midi_info
 int
 mpu_intr(void *addr)
 {
-       struct mpu_softc *sc = addr;
+       struct mpu_softc *sc = device_private(addr);
 
        if (MPU_GETSTATUS(sc->iot, sc->ioh) & MPU_INPUT_EMPTY) {
                DPRINTF(("%s: no data\n", __func__));
Index: pci/ydsvar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ydsvar.h,v
retrieving revision 1.8
diff -b -u -p -r1.8 ydsvar.h
--- pci/ydsvar.h        4 Mar 2007 06:02:27 -0000       1.8
+++ pci/ydsvar.h        29 Mar 2008 18:15:37 -0000
@@ -107,7 +107,7 @@ struct yds_softc {
         */
        bus_space_tag_t         sc_legacy_iot;
        bus_space_handle_t      sc_opl_ioh;
-       struct device           *sc_mpu;
+       device_t                sc_mpu;
        bus_space_handle_t      sc_mpu_ioh;
 
        struct audio_encoding_set *sc_encodings;

AFAIK, all mpu drivers should be passing the device_t to mpu_intr()
so device_private() should return correctly the softc.

I checked all the other drivers, they seem to be ok.

-- 
Juan Romero Pardines - xtraeme at gmail|netbsd dot org
        The NetBSD Project

Make your own NetBSD/x86 Live CD
http://www.netbsd.org/~xtraeme/mklivecd/


Home | Main Index | Thread Index | Old Index