Module Name: src Committed By: mrg Date: Sun Jul 17 23:32:37 UTC 2011
Modified Files: src/sys/arch/sparc/sparc: auxiotwo.c clkctrl.c eeprom.c memreg.c msiiep.c msiiepvar.h Log Message: convert all the "empty softc" (just "struct device") drivers to using device_t/cfdata_t and CFATTACH_DECL_NEW(). the mspcic driver was also converted since it does not ever touch the sc_dev it used to have in there. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sparc/sparc/auxiotwo.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sparc/sparc/clkctrl.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc/sparc/eeprom.c cvs rdiff -u -r1.43 -r1.44 src/sys/arch/sparc/sparc/memreg.c cvs rdiff -u -r1.41 -r1.42 src/sys/arch/sparc/sparc/msiiep.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sparc/sparc/msiiepvar.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/sparc/sparc/auxiotwo.c diff -u src/sys/arch/sparc/sparc/auxiotwo.c:1.9 src/sys/arch/sparc/sparc/auxiotwo.c:1.10 --- src/sys/arch/sparc/sparc/auxiotwo.c:1.9 Mon Apr 28 20:23:36 2008 +++ src/sys/arch/sparc/sparc/auxiotwo.c Sun Jul 17 23:32:37 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: auxiotwo.c,v 1.9 2008/04/28 20:23:36 martin Exp $ */ +/* $NetBSD: auxiotwo.c,v 1.10 2011/07/17 23:32:37 mrg Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: auxiotwo.c,v 1.9 2008/04/28 20:23:36 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: auxiotwo.c,v 1.10 2011/07/17 23:32:37 mrg Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -51,17 +51,17 @@ static int serial_refcount; static int serial_power; -static int auxiotwomatch(struct device *, struct cfdata *, void *); -static void auxiotwoattach(struct device *, struct device *, void *); +static int auxiotwomatch(device_t, cfdata_t, void *); +static void auxiotwoattach(device_t, device_t, void *); -CFATTACH_DECL(auxiotwo_obio, sizeof(struct device), +CFATTACH_DECL_NEW(auxiotwo_obio, 0, auxiotwomatch, auxiotwoattach, NULL, NULL); /* * The OPENPROM calls this "auxio2". */ static int -auxiotwomatch(struct device *parent, struct cfdata *cf, void *aux) +auxiotwomatch(device_t parent, cfdata_t cf, void *aux) { union obio_attach_args *uoba = aux; @@ -72,7 +72,7 @@ } static void -auxiotwoattach(struct device *parent, struct device *self, void *aux) +auxiotwoattach(device_t parent, device_t self, void *aux) { union obio_attach_args *uoba = aux; struct sbus_attach_args *sa = &uoba->uoba_sbus; Index: src/sys/arch/sparc/sparc/clkctrl.c diff -u src/sys/arch/sparc/sparc/clkctrl.c:1.4 src/sys/arch/sparc/sparc/clkctrl.c:1.5 --- src/sys/arch/sparc/sparc/clkctrl.c:1.4 Thu May 8 02:16:27 2008 +++ src/sys/arch/sparc/sparc/clkctrl.c Sun Jul 17 23:32:37 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: clkctrl.c,v 1.4 2008/05/08 02:16:27 macallan Exp $ */ +/* $NetBSD: clkctrl.c,v 1.5 2011/07/17 23:32:37 mrg Exp $ */ /* * Copyright (c) 2005 Michael Lorenz @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: clkctrl.c,v 1.4 2008/05/08 02:16:27 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clkctrl.c,v 1.5 2011/07/17 23:32:37 mrg Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -38,17 +38,17 @@ #include <sparc/sparc/vaddrs.h> -static int clkctrl_match(struct device *, struct cfdata *, void *); -static void clkctrl_attach(struct device *, struct device *, void *); +static int clkctrl_match(device_t, cfdata_t, void *); +static void clkctrl_attach(device_t, device_t, void *); -CFATTACH_DECL(clkctrl, sizeof(struct device), +CFATTACH_DECL_NEW(clkctrl, 0, clkctrl_match, clkctrl_attach, NULL, NULL); static void tadpole_cpu_sleep(struct cpu_info *); volatile uint8_t *clkctrl_reg = NULL; static int -clkctrl_match(struct device *parent, struct cfdata *cf, void *aux) +clkctrl_match(device_t parent, cfdata_t cf, void *aux) { union obio_attach_args *uoba = aux; @@ -59,7 +59,7 @@ } static void -clkctrl_attach(struct device *parent, struct device *self, void *aux) +clkctrl_attach(device_t parent, device_t self, void *aux) { union obio_attach_args *uoba = aux; struct sbus_attach_args *sa = &uoba->uoba_sbus; Index: src/sys/arch/sparc/sparc/eeprom.c diff -u src/sys/arch/sparc/sparc/eeprom.c:1.8 src/sys/arch/sparc/sparc/eeprom.c:1.9 --- src/sys/arch/sparc/sparc/eeprom.c:1.8 Fri Jul 1 18:51:51 2011 +++ src/sys/arch/sparc/sparc/eeprom.c Sun Jul 17 23:32:37 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: eeprom.c,v 1.8 2011/07/01 18:51:51 dyoung Exp $ */ +/* $NetBSD: eeprom.c,v 1.9 2011/07/17 23:32:37 mrg Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: eeprom.c,v 1.8 2011/07/01 18:51:51 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: eeprom.c,v 1.9 2011/07/17 23:32:37 mrg Exp $"); #include "opt_sparc_arch.h" @@ -58,10 +58,10 @@ /* Imported from clock.c: */ extern char *eeprom_va; -static int eeprom_match(struct device *, struct cfdata *, void *); -static void eeprom_attach(struct device *, struct device *, void *); +static int eeprom_match(device_t, cfdata_t, void *); +static void eeprom_attach(device_t, device_t, void *); -CFATTACH_DECL(eeprom, sizeof(struct device), +CFATTACH_DECL_NEW(eeprom, 0, eeprom_match, eeprom_attach, NULL, NULL); /* We support only one eeprom device */ @@ -71,7 +71,7 @@ * Sun 4/100, 4/200 EEPROM match routine. */ static int -eeprom_match(struct device *parent, struct cfdata *cf, void *aux) +eeprom_match(device_t parent, cfdata_t cf, void *aux) { union obio_attach_args *uoba = aux; struct obio4_attach_args *oba; @@ -99,7 +99,7 @@ } static void -eeprom_attach(struct device *parent, struct device *self, void *aux) +eeprom_attach(device_t parent, device_t self, void *aux) { #if defined(SUN4) union obio_attach_args *uoba = aux; @@ -114,7 +114,8 @@ EEPROM_SIZE, BUS_SPACE_MAP_LINEAR, /* flags */ &bh) != 0) { - printf("%s: can't map register\n", self->dv_xname); + printf("%s: can't map register\n", + device_xname(self)); return; } eeprom_va = (char *)bh; Index: src/sys/arch/sparc/sparc/memreg.c diff -u src/sys/arch/sparc/sparc/memreg.c:1.43 src/sys/arch/sparc/sparc/memreg.c:1.44 --- src/sys/arch/sparc/sparc/memreg.c:1.43 Wed Dec 17 19:09:56 2008 +++ src/sys/arch/sparc/sparc/memreg.c Sun Jul 17 23:32:37 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: memreg.c,v 1.43 2008/12/17 19:09:56 cegger Exp $ */ +/* $NetBSD: memreg.c,v 1.44 2011/07/17 23:32:37 mrg Exp $ */ /* * Copyright (c) 1992, 1993 @@ -47,7 +47,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: memreg.c,v 1.43 2008/12/17 19:09:56 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: memreg.c,v 1.44 2011/07/17 23:32:37 mrg Exp $"); #include "opt_sparc_arch.h" @@ -68,15 +68,15 @@ #include <machine/reg.h> /* for trapframe */ #include <machine/trap.h> /* for trap types */ -static int memregmatch_mainbus(struct device *, struct cfdata *, void *); -static int memregmatch_obio(struct device *, struct cfdata *, void *); -static void memregattach_mainbus(struct device *, struct device *, void *); -static void memregattach_obio(struct device *, struct device *, void *); +static int memregmatch_mainbus(device_t, cfdata_t, void *); +static int memregmatch_obio(device_t, cfdata_t, void *); +static void memregattach_mainbus(device_t, device_t, void *); +static void memregattach_obio(device_t, device_t, void *); -CFATTACH_DECL(memreg_mainbus, sizeof(struct device), +CFATTACH_DECL_NEW(memreg_mainbus, 0, memregmatch_mainbus, memregattach_mainbus, NULL, NULL); -CFATTACH_DECL(memreg_obio, sizeof(struct device), +CFATTACH_DECL_NEW(memreg_obio, 0, memregmatch_obio, memregattach_obio, NULL, NULL); #if defined(SUN4M) @@ -87,7 +87,7 @@ * The OPENPROM calls this "memory-error". */ static int -memregmatch_mainbus(struct device *parent, struct cfdata *cf, void *aux) +memregmatch_mainbus(device_t parent, cfdata_t cf, void *aux) { struct mainbus_attach_args *ma = aux; @@ -95,7 +95,7 @@ } static int -memregmatch_obio(struct device *parent, struct cfdata *cf, void *aux) +memregmatch_obio(device_t parent, cfdata_t cf, void *aux) { union obio_attach_args *uoba = aux; @@ -112,7 +112,7 @@ /* ARGSUSED */ static void -memregattach_mainbus(struct device *parent, struct device *self, void *aux) +memregattach_mainbus(device_t parent, device_t self, void *aux) { struct mainbus_attach_args *ma = aux; bus_space_handle_t bh; @@ -136,7 +136,7 @@ /* ARGSUSED */ static void -memregattach_obio(struct device *parent, struct device *self, void *aux) +memregattach_obio(device_t parent, device_t self, void *aux) { union obio_attach_args *uoba = aux; bus_space_handle_t bh; Index: src/sys/arch/sparc/sparc/msiiep.c diff -u src/sys/arch/sparc/sparc/msiiep.c:1.41 src/sys/arch/sparc/sparc/msiiep.c:1.42 --- src/sys/arch/sparc/sparc/msiiep.c:1.41 Fri Jul 1 18:51:51 2011 +++ src/sys/arch/sparc/sparc/msiiep.c Sun Jul 17 23:32:37 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: msiiep.c,v 1.41 2011/07/01 18:51:51 dyoung Exp $ */ +/* $NetBSD: msiiep.c,v 1.42 2011/07/17 23:32:37 mrg Exp $ */ /* * Copyright (c) 2001 Valeriy E. Ushakov @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: msiiep.c,v 1.41 2011/07/01 18:51:51 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msiiep.c,v 1.42 2011/07/17 23:32:37 mrg Exp $"); #include <sys/param.h> #include <sys/malloc.h> @@ -65,11 +65,10 @@ /* * "Stub" ms-IIep parent that knows how to attach various functions. */ -static int msiiep_match(struct device *, struct cfdata *, void *); -static void msiiep_attach(struct device *, struct device *, void *); +static int msiiep_match(device_t, cfdata_t, void *); +static void msiiep_attach(device_t, device_t, void *); -CFATTACH_DECL(msiiep, sizeof(struct device), - msiiep_match, msiiep_attach, NULL, NULL); +CFATTACH_DECL_NEW(msiiep, 0, msiiep_match, msiiep_attach, NULL, NULL); /* sleep in idle spin */ @@ -80,8 +79,8 @@ /* * The real thing. */ -static int mspcic_match(struct device *, struct cfdata *, void *); -static void mspcic_attach(struct device *, struct device *, void *); +static int mspcic_match(device_t, cfdata_t, void *); +static void mspcic_attach(device_t, device_t, void *); static int mspcic_print(void *, const char *); CFATTACH_DECL(mspcic, sizeof(struct mspcic_softc), @@ -192,7 +191,7 @@ static int -msiiep_match(struct device *parent, struct cfdata *cf, void *aux) +msiiep_match(device_t parent, cfdata_t cf, void *aux) { struct mainbus_attach_args *ma = aux; pcireg_t id; @@ -216,7 +215,7 @@ static void -msiiep_attach(struct device *parent, struct device *self, void *aux) +msiiep_attach(device_t parent, device_t self, void *aux) { struct mainbus_attach_args *ma = aux; struct msiiep_attach_args msa; @@ -268,7 +267,7 @@ */ static int -mspcic_match(struct device *parent, struct cfdata *cf, void *aux) +mspcic_match(device_t parent, cfdata_t cf, void *aux) { struct msiiep_attach_args *msa = aux; @@ -277,7 +276,7 @@ static void -mspcic_attach(struct device *parent, struct device *self, void *aux) +mspcic_attach(device_t parent, device_t self, void *aux) { struct mspcic_softc *sc = (struct mspcic_softc *)self; struct msiiep_attach_args *msa = aux; Index: src/sys/arch/sparc/sparc/msiiepvar.h diff -u src/sys/arch/sparc/sparc/msiiepvar.h:1.7 src/sys/arch/sparc/sparc/msiiepvar.h:1.8 --- src/sys/arch/sparc/sparc/msiiepvar.h:1.7 Sun Dec 11 12:19:08 2005 +++ src/sys/arch/sparc/sparc/msiiepvar.h Sun Jul 17 23:32:37 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: msiiepvar.h,v 1.7 2005/12/11 12:19:08 christos Exp $ */ +/* $NetBSD: msiiepvar.h,v 1.8 2011/07/17 23:32:37 mrg Exp $ */ /* * Copyright (c) 2001 Valeriy E. Ushakov @@ -36,8 +36,6 @@ }; struct mspcic_softc { - struct device sc_dev; - /* PROM node */ int sc_node;