Module Name: src Committed By: tsutsui Date: Tue Jun 9 11:01:18 UTC 2009
Modified Files: src/sys/dev/pci: emuxki.c emuxkivar.h Log Message: Split device_t/softc. Tested on: emuxki0 at pci2 dev 7 function 0: Creative Labs SBLive! EMU 10000 (audio multimedia, revision 0x05) To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/dev/pci/emuxki.c cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/emuxkivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/emuxki.c diff -u src/sys/dev/pci/emuxki.c:1.57 src/sys/dev/pci/emuxki.c:1.58 --- src/sys/dev/pci/emuxki.c:1.57 Tue May 12 08:23:00 2009 +++ src/sys/dev/pci/emuxki.c Tue Jun 9 11:01:18 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: emuxki.c,v 1.57 2009/05/12 08:23:00 cegger Exp $ */ +/* $NetBSD: emuxki.c,v 1.58 2009/06/09 11:01:18 tsutsui Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -49,7 +49,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.57 2009/05/12 08:23:00 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.58 2009/06/09 11:01:18 tsutsui Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -169,7 +169,7 @@ /* * Autoconfig goo. */ -CFATTACH_DECL(emuxki, sizeof(struct emuxki_softc), +CFATTACH_DECL_NEW(emuxki, sizeof(struct emuxki_softc), emuxki_match, emuxki_attach, emuxki_detach, NULL); static const struct audio_hw_if emuxki_hw_if = { @@ -376,7 +376,7 @@ sc->hostif.write = emuxki_ac97_write; sc->hostif.reset = emuxki_ac97_reset; sc->hostif.flags = emuxki_ac97_flags; - return ac97_attach(&sc->hostif, &sc->sc_dev); + return ac97_attach(&sc->hostif, sc->sc_dev); } static int @@ -408,6 +408,7 @@ const char *intrstr; sc = device_private(self); + sc->sc_dev = self; pa = aux; aprint_naive(": Audio controller\n"); @@ -427,7 +428,7 @@ (PCI_COMMAND_STATUS_REG) | PCI_COMMAND_MASTER_ENABLE)); if (pci_intr_map(pa, &ih)) { - aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n"); + aprint_error_dev(self, "couldn't map interrupt\n"); bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_ios); return; } @@ -436,14 +437,14 @@ sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_AUDIO, emuxki_intr, sc); if (sc->sc_ih == NULL) { - aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt"); + aprint_error_dev(self, "couldn't establish interrupt"); if (intrstr != NULL) aprint_normal(" at %s", intrstr); aprint_normal("\n"); bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_ios); return; } - aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr); + aprint_normal_dev(self, "interrupting at %s\n", intrstr); /* XXX it's unknown whether APS is made from Audigy as well */ if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CREATIVELABS_AUDIGY) { @@ -2024,7 +2025,7 @@ sc = addr; #ifdef EMUXKI_DEBUG - printf("%s: emuxki_open called\n", device_xname(&sc->sc_dev)); + printf("%s: emuxki_open called\n", device_xname(sc->sc_dev)); #endif /* @@ -2069,7 +2070,7 @@ sc = addr; #ifdef EMUXKI_DEBUG - printf("%s: emu10K1_close called\n", device_xname(&sc->sc_dev)); + printf("%s: emu10K1_close called\n", device_xname(sc->sc_dev)); #endif /* No multiple voice support for now */ @@ -2090,7 +2091,7 @@ struct emuxki_softc *sc; sc = addr; - printf("%s: emuxki_query_encoding called\n", device_xname(&sc->sc_dev)); + printf("%s: emuxki_query_encoding called\n", device_xname(sc->sc_dev)); #endif switch (fp->index) { @@ -2225,7 +2226,7 @@ sc = addr; #ifdef EMUXKI_DEBUG - printf("%s: emuxki_halt_input called\n", device_xname(&sc->sc_dev)); + printf("%s: emuxki_halt_input called\n", device_xname(sc->sc_dev)); #endif /* No multiple voice support for now */ Index: src/sys/dev/pci/emuxkivar.h diff -u src/sys/dev/pci/emuxkivar.h:1.11 src/sys/dev/pci/emuxkivar.h:1.12 --- src/sys/dev/pci/emuxkivar.h:1.11 Mon Apr 28 20:23:54 2008 +++ src/sys/dev/pci/emuxkivar.h Tue Jun 9 11:01:18 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: emuxkivar.h,v 1.11 2008/04/28 20:23:54 martin Exp $ */ +/* $NetBSD: emuxkivar.h,v 1.12 2009/06/09 11:01:18 tsutsui Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -217,7 +217,7 @@ #endif /* Not yet */ struct emuxki_softc { - struct device sc_dev; + device_t sc_dev; audio_device_t sc_audv; enum { EMUXKI_SBLIVE = 0x00, EMUXKI_AUDIGY = 0x01, @@ -251,7 +251,7 @@ struct ac97_host_if hostif; struct ac97_codec_if *codecif; - struct device *sc_audev; + device_t sc_audev; struct emuxki_voice *pvoice, *rvoice, *lvoice; };