Module Name:    src
Committed By:   christos
Date:           Fri Jun  3 02:58:07 UTC 2011

Modified Files:
        src/sys/arch/sparc64/dev: schizo.c schizovar.h

Log Message:
CFATTACH_DECL_NEW


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/sparc64/dev/schizo.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sparc64/dev/schizovar.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/arch/sparc64/dev/schizo.c
diff -u src/sys/arch/sparc64/dev/schizo.c:1.20 src/sys/arch/sparc64/dev/schizo.c:1.21
--- src/sys/arch/sparc64/dev/schizo.c:1.20	Tue May 17 13:34:53 2011
+++ src/sys/arch/sparc64/dev/schizo.c	Thu Jun  2 22:58:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: schizo.c,v 1.20 2011/05/17 17:34:53 dyoung Exp $	*/
+/*	$NetBSD: schizo.c,v 1.21 2011/06/03 02:58:07 christos Exp $	*/
 /*	$OpenBSD: schizo.c,v 1.55 2008/08/18 20:29:37 brad Exp $	*/
 
 /*
@@ -66,8 +66,8 @@
 
 extern struct sparc_pci_chipset _sparc_pci_chipset;
 
-static	int	schizo_match(struct device *, struct cfdata *, void *);
-static	void	schizo_attach(struct device *, struct device *, void *);
+static	int	schizo_match(device_t, cfdata_t, void *);
+static	void	schizo_attach(device_t, device_t, void *);
 static	int	schizo_print(void *aux, const char *p);
 
 CFATTACH_DECL(schizo, sizeof(struct schizo_softc),
@@ -108,7 +108,7 @@
 	bus_size_t, int, bus_dmamap_t *);
 
 int
-schizo_match(struct device *parent, struct cfdata *match, void *aux)
+schizo_match(struct device *parent, cfdata_t match, void *aux)
 {
 	struct mainbus_attach_args *ma = aux;
 	char *str;
@@ -134,7 +134,7 @@
 void
 schizo_attach(struct device *parent, struct device *self, void *aux)
 {
-	struct schizo_softc *sc = (struct schizo_softc *)self;
+	struct schizo_softc *sc = device_private(self);
 	struct mainbus_attach_args *ma = aux;
 	struct schizo_pbm *pbm;
 	struct iommu_state *is;
@@ -148,7 +148,7 @@
 	str = prom_getpropstring(ma->ma_node, "compatible");
 	if (strcmp(str, "pci108e,a801") == 0)
 		sc->sc_tomatillo = 1;
-
+	sc->sc_dev = self;
 	sc->sc_node = ma->ma_node;
 	sc->sc_dmat = ma->ma_dmatag;
 	sc->sc_bustag = ma->ma_bustag;
@@ -217,7 +217,7 @@
 	pbm->sp_sb.sb_is = is;
 	no_sc = prom_getproplen(sc->sc_node, "no-streaming-cache") >= 0;
 	if (no_sc)
-		aprint_debug("%s: no streaming buffers\n", sc->sc_dv.dv_xname);
+		aprint_debug_dev(sc->sc_dev, "no streaming buffers\n");
 	else {
 		vaddr_t va = (vaddr_t)&pbm->sp_flush[0x40];
 
@@ -234,7 +234,7 @@
 			sizeof(struct iommu_strbuf), &is->is_sb[0]->sb_sb);
 	}
 
-	aprint_normal("%s: ", sc->sc_dv.dv_xname);
+	aprint_normal_dev(sc->sc_dev, " ");
 	schizo_init_iommu(sc, pbm);
 
 	pbm->sp_memt = schizo_alloc_mem_tag(pbm);
@@ -315,7 +315,7 @@
 		schizo_pbm_write(pbm, SCZ_PCI_IOCACHE_CSR, iocache_csr);
 	}
 
-	config_found(&sc->sc_dv, &pba, schizo_print);
+	config_found(sc->sc_dev, &pba, schizo_print);
 }
 
 int
@@ -323,7 +323,7 @@
 {
 	struct schizo_softc *sc = vsc;
 
-	panic("%s: uncorrectable error", sc->sc_dv.dv_xname);
+	panic("%s: uncorrectable error", device_xname(sc->sc_dev));
 	return (1);
 }
 
@@ -332,7 +332,7 @@
 {
 	struct schizo_softc *sc = vsc;
 
-	panic("%s: correctable error", sc->sc_dv.dv_xname);
+	panic("%s: correctable error", device_xname(sc->sc_dev));
 	return (1);
 }
 
@@ -350,7 +350,7 @@
 	ctrl = schizo_pbm_read(sp, SCZ_PCI_CTRL);
 	csr = schizo_cfg_read(sp, PCI_COMMAND_STATUS_REG);
 
-	printf("%s: pci bus %c error\n", sc->sc_dv.dv_xname,
+	printf("%s: pci bus %c error\n", device_xname(sc->sc_dev),
 	    sp->sp_bus_a ? 'A' : 'B');
 
 	snprintb(bits, sizeof(bits), SCZ_PCIAFSR_BITS, afsr);
@@ -386,7 +386,7 @@
 		}
 	}
 
-	panic("%s: fatal", sc->sc_dv.dv_xname);
+	panic("%s: fatal", device_xname(sc->sc_dev));
 
  clear_error:
 	schizo_cfg_write(sp, PCI_COMMAND_STATUS_REG, csr);
@@ -400,7 +400,7 @@
 {
 	struct schizo_softc *sc = vsc;
 
-	printf("%s: safari error\n", sc->sc_dv.dv_xname);
+	printf("%s: safari error\n", device_xname(sc->sc_dev));
 
 	printf("ERRLOG=%" PRIx64 "\n", schizo_read(sc, SCZ_SAFARI_ERRLOG));
 	printf("UE_AFSR=%" PRIx64 "\n", schizo_read(sc, SCZ_UE_AFSR));
@@ -408,7 +408,7 @@
 	printf("CE_AFSR=%" PRIx64 "\n", schizo_read(sc, SCZ_CE_AFSR));
 	printf("CE_AFAR=%" PRIx64 "\n", schizo_read(sc, SCZ_CE_AFAR));
 
-	panic("%s: fatal", sc->sc_dv.dv_xname);
+	panic("%s: fatal", device_xname(sc->sc_dev));
 	return (1);
 }
 
@@ -455,7 +455,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));
 
 	iommu_init(name, is, tsbsize, iobase);
 }

Index: src/sys/arch/sparc64/dev/schizovar.h
diff -u src/sys/arch/sparc64/dev/schizovar.h:1.4 src/sys/arch/sparc64/dev/schizovar.h:1.5
--- src/sys/arch/sparc64/dev/schizovar.h:1.4	Fri Feb  5 19:23:30 2010
+++ src/sys/arch/sparc64/dev/schizovar.h	Thu Jun  2 22:58:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: schizovar.h,v 1.4 2010/02/06 00:23:30 mrg Exp $	*/
+/*	$NetBSD: schizovar.h,v 1.5 2011/06/03 02:58:07 christos Exp $	*/
 /*	$OpenBSD: schizovar.h,v 1.10 2007/01/14 16:19:49 kettenis Exp $	*/
 
 /*
@@ -53,7 +53,7 @@
 };
 
 struct schizo_softc {
-	struct device sc_dv;
+	device_t sc_dev;
 	int sc_node;
 	int sc_ign;
 	bus_dma_tag_t sc_dmat;

Reply via email to