Module Name:    src
Committed By:   christos
Date:           Fri Jun  3 03:01:23 UTC 2011

Modified Files:
        src/sys/arch/sparc64/dev: pyro.c

Log Message:
CFATTACH_DECL_NEW


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc64/dev/pyro.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc64/dev/pyro.c
diff -u src/sys/arch/sparc64/dev/pyro.c:1.5 src/sys/arch/sparc64/dev/pyro.c:1.6
--- src/sys/arch/sparc64/dev/pyro.c:1.5	Tue May 17 13:34:53 2011
+++ src/sys/arch/sparc64/dev/pyro.c	Thu Jun  2 23:01:23 2011
@@ -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;

Reply via email to