Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/dev CFATTACH_DECL_NEW



details:   https://anonhg.NetBSD.org/src/rev/a0458df58447
branches:  trunk
changeset: 765691:a0458df58447
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jun 03 03:01:23 2011 +0000

description:
CFATTACH_DECL_NEW

diffstat:

 sys/arch/sparc64/dev/pyro.c |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (79 lines):

diff -r a707c65529e2 -r a0458df58447 sys/arch/sparc64/dev/pyro.c
--- a/sys/arch/sparc64/dev/pyro.c       Fri Jun 03 02:48:33 2011 +0000
+++ b/sys/arch/sparc64/dev/pyro.c       Fri Jun 03 03:01:23 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pyro.c,v 1.5 2011/05/17 17:34:53 dyoung Exp $  */
+/*     $NetBSD: pyro.c,v 1.6 2011/06/03 03:01:23 christos Exp $        */
 /*     from: $OpenBSD: pyro.c,v 1.20 2010/12/05 15:15:14 kettenis Exp $        */
 
 /*
@@ -79,8 +79,8 @@
 
 extern struct sparc_pci_chipset _sparc_pci_chipset;
 
-int pyro_match(struct device *, struct cfdata *, void *);
-void pyro_attach(struct device *, struct device *, void *);
+int pyro_match(device_t, cfdata_t, void *);
+void pyro_attach(device_t, device_t, void *);
 int pyro_print(void *, const char *);
 
 CFATTACH_DECL(pyro, sizeof(struct pyro_softc),
@@ -119,7 +119,7 @@
     bus_size_t, bus_size_t, int, bus_dmamap_t *);
 
 int
-pyro_match(struct device *parent, struct cfdata *match, void *aux)
+pyro_match(struct device *parent, cfdata_t match, void *aux)
 {
        struct mainbus_attach_args *ma = aux;
        char *str;
@@ -138,11 +138,12 @@
 void
 pyro_attach(struct device *parent, struct device *self, void *aux)
 {
-       struct pyro_softc *sc = (struct pyro_softc *)self;
+       struct pyro_softc *sc = device_private(self);
        struct mainbus_attach_args *ma = aux;
        char *str;
        int busa;
 
+       sc->sc_dev = self;
        sc->sc_node = ma->ma_node;
        sc->sc_dmat = ma->ma_dmatag;
        sc->sc_bustag = ma->ma_bustag;
@@ -201,7 +202,7 @@
            prom_getpropint(sc->sc_node, "module-revision#", 0), sc->sc_ign,
            busa ? 'A' : 'B', busranges[0], busranges[1]);
 
-       printf("%s: ", sc->sc_dv.dv_xname);
+       printf("%s: ", device_xname(sc->sc_dev));
        pyro_init_iommu(sc, pbm);
 
        pbm->pp_memt = pyro_alloc_mem_tag(pbm);
@@ -237,7 +238,7 @@
 
        free(busranges, M_DEVBUF);
 
-       config_found(&sc->sc_dv, &pba, pyro_print);
+       config_found(sc->sc_dev, &pba, pyro_print);
 }
 
 void
@@ -262,7 +263,7 @@
        name = (char *)malloc(32, M_DEVBUF, M_NOWAIT);
        if (name == NULL)
                panic("couldn't malloc iommu name");
-       snprintf(name, 32, "%s dvma", sc->sc_dv.dv_xname);
+       snprintf(name, 32, "%s dvma", device_xname(sc->sc_dev));
 
        /* Tell iommu how to set the TSB size.  */
        is->is_flags = IOMMU_TSBSIZE_IN_PTSB;
@@ -387,7 +388,7 @@
 
 #if 0
        snprintf(bt->name, sizeof(bt->name), "%s-pbm_%s(%d/%2.2x)",
-           sc->sc_dv.dv_xname, name, ss, asi);
+           device_xname(sc->sc_dev), name, ss, asi);
 #endif
 
        bt->cookie = pbm;



Home | Main Index | Thread Index | Old Index