Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/sparc convert all the "empty softc" (just "st...



details:   https://anonhg.NetBSD.org/src/rev/ad9bcf4ec2d4
branches:  trunk
changeset: 767392:ad9bcf4ec2d4
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Jul 17 23:32:37 2011 +0000

description:
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.

diffstat:

 sys/arch/sparc/sparc/auxiotwo.c  |  14 +++++++-------
 sys/arch/sparc/sparc/clkctrl.c   |  14 +++++++-------
 sys/arch/sparc/sparc/eeprom.c    |  17 +++++++++--------
 sys/arch/sparc/sparc/memreg.c    |  24 ++++++++++++------------
 sys/arch/sparc/sparc/msiiep.c    |  23 +++++++++++------------
 sys/arch/sparc/sparc/msiiepvar.h |   4 +---
 6 files changed, 47 insertions(+), 49 deletions(-)

diffs (truncated from 332 to 300 lines):

diff -r 094c4f76226d -r ad9bcf4ec2d4 sys/arch/sparc/sparc/auxiotwo.c
--- a/sys/arch/sparc/sparc/auxiotwo.c   Sun Jul 17 23:32:21 2011 +0000
+++ b/sys/arch/sparc/sparc/auxiotwo.c   Sun Jul 17 23:32:37 2011 +0000
@@ -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;
diff -r 094c4f76226d -r ad9bcf4ec2d4 sys/arch/sparc/sparc/clkctrl.c
--- a/sys/arch/sparc/sparc/clkctrl.c    Sun Jul 17 23:32:21 2011 +0000
+++ b/sys/arch/sparc/sparc/clkctrl.c    Sun Jul 17 23:32:37 2011 +0000
@@ -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;
diff -r 094c4f76226d -r ad9bcf4ec2d4 sys/arch/sparc/sparc/eeprom.c
--- a/sys/arch/sparc/sparc/eeprom.c     Sun Jul 17 23:32:21 2011 +0000
+++ b/sys/arch/sparc/sparc/eeprom.c     Sun Jul 17 23:32:37 2011 +0000
@@ -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;
diff -r 094c4f76226d -r ad9bcf4ec2d4 sys/arch/sparc/sparc/memreg.c
--- a/sys/arch/sparc/sparc/memreg.c     Sun Jul 17 23:32:21 2011 +0000
+++ b/sys/arch/sparc/sparc/memreg.c     Sun Jul 17 23:32:37 2011 +0000
@@ -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;
diff -r 094c4f76226d -r ad9bcf4ec2d4 sys/arch/sparc/sparc/msiiep.c
--- a/sys/arch/sparc/sparc/msiiep.c     Sun Jul 17 23:32:21 2011 +0000
+++ b/sys/arch/sparc/sparc/msiiep.c     Sun Jul 17 23:32:37 2011 +0000
@@ -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



Home | Main Index | Thread Index | Old Index