Source-Changes-HG archive

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

[src/trunk]: src/sys/arch struct device * -> device_t for IXP4xx (and nslu2).



details:   https://anonhg.NetBSD.org/src/rev/81a8bdb5db95
branches:  trunk
changeset: 782072:81a8bdb5db95
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Sun Oct 14 14:20:57 2012 +0000

description:
struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.

diffstat:

 sys/arch/arm/xscale/becc.c                |  16 +++----
 sys/arch/arm/xscale/becc_pci.c            |  10 ++--
 sys/arch/arm/xscale/beccvar.h             |   4 +-
 sys/arch/arm/xscale/i80312.c              |  18 ++++----
 sys/arch/arm/xscale/i80312_pci.c          |  10 ++--
 sys/arch/arm/xscale/i80312var.h           |   4 +-
 sys/arch/arm/xscale/i80321_pci.c          |   8 ++--
 sys/arch/arm/xscale/ixp425.c              |  16 ++++---
 sys/arch/arm/xscale/ixp425_ixme.c         |  27 ++++++-------
 sys/arch/arm/xscale/ixp425_npe.c          |  59 +++++++++++++++---------------
 sys/arch/arm/xscale/ixp425_npevar.h       |   4 +-
 sys/arch/arm/xscale/ixp425_pci.c          |  10 ++--
 sys/arch/arm/xscale/ixp425_sip.c          |  28 ++++++-------
 sys/arch/arm/xscale/ixp425_sipvar.h       |   3 +-
 sys/arch/arm/xscale/ixp425_timer.c        |  25 ++++++------
 sys/arch/arm/xscale/ixp425_wdog.c         |  29 ++++++--------
 sys/arch/arm/xscale/ixp425var.h           |   6 +-
 sys/arch/evbarm/ixdp425/ixdp425_led.c     |  19 ++++-----
 sys/arch/evbarm/ixdp425/ixdp425_mainbus.c |  17 ++++----
 sys/arch/evbarm/nslu2/nslu2_buttons.c     |  30 ++++++++-------
 sys/arch/evbarm/nslu2/nslu2_iic.c         |  17 ++++----
 sys/arch/evbarm/nslu2/nslu2_leds.c        |  18 ++++-----
 sys/arch/evbarm/nslu2/nslu2_mainbus.c     |  12 +++---
 23 files changed, 188 insertions(+), 202 deletions(-)

diffs (truncated from 1434 to 300 lines):

diff -r 45e36453255f -r 81a8bdb5db95 sys/arch/arm/xscale/becc.c
--- a/sys/arch/arm/xscale/becc.c        Sun Oct 14 13:54:39 2012 +0000
+++ b/sys/arch/arm/xscale/becc.c        Sun Oct 14 14:20:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: becc.c,v 1.15 2012/09/18 05:47:28 matt Exp $   */
+/*     $NetBSD: becc.c,v 1.16 2012/10/14 14:20:57 msaitoh Exp $        */
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: becc.c,v 1.15 2012/09/18 05:47:28 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: becc.c,v 1.16 2012/10/14 14:20:57 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -77,8 +77,7 @@
  */
 struct becc_softc *becc_softc;
 
-static int becc_search(struct device *, struct cfdata *,
-                      const int *, void *);
+static int becc_search(device_t, cfdata_t, const int *, void *);
 static int becc_print(void *, const char *);
 
 static void becc_pci_dma_init(struct becc_softc *);
@@ -194,7 +193,7 @@
         * the BECC is a soft-core with a variety of peripherals, depending
         * on configuration.
         */
-       config_search_ia(becc_search, &sc->sc_dev, "becc", NULL);
+       config_search_ia(becc_search, sc->sc_dev, "becc", NULL);
 
        /*
         * Attach the PCI bus.
@@ -210,7 +209,7 @@
        pba.pba_intrtag = 0;
        pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
-       (void) config_found_ia(&sc->sc_dev, "pcibus", &pba, pcibusprint);
+       (void) config_found_ia(sc->sc_dev, "pcibus", &pba, pcibusprint);
 }
 
 /*
@@ -219,10 +218,9 @@
  *     Indirect autoconfiguration glue for BECC.
  */
 static int
-becc_search(struct device *parent, struct cfdata *cf,
-           const int *ldesc, void *aux)
+becc_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
 {
-       struct becc_softc *sc = (void *) parent;
+       struct becc_softc *sc = device_private(parent);
        struct becc_attach_args ba;
 
        ba.ba_dmat = &sc->sc_local_dmat;
diff -r 45e36453255f -r 81a8bdb5db95 sys/arch/arm/xscale/becc_pci.c
--- a/sys/arch/arm/xscale/becc_pci.c    Sun Oct 14 13:54:39 2012 +0000
+++ b/sys/arch/arm/xscale/becc_pci.c    Sun Oct 14 14:20:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: becc_pci.c,v 1.12 2012/09/07 02:11:32 matt Exp $       */
+/*     $NetBSD: becc_pci.c,v 1.13 2012/10/14 14:20:57 msaitoh Exp $    */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: becc_pci.c,v 1.12 2012/09/07 02:11:32 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: becc_pci.c,v 1.13 2012/10/14 14:20:57 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -62,7 +62,7 @@
 #include "opt_pci.h"
 #include "pci.h"
 
-void           becc_pci_attach_hook(struct device *, struct device *,
+void           becc_pci_attach_hook(device_t, device_t,
                    struct pcibus_attach_args *);
 int            becc_pci_bus_maxdevs(void *, int);
 pcitag_t       becc_pci_make_tag(void *, int, int, int);
@@ -132,7 +132,7 @@
            sc->sc_owin_xlate[0] + BECC_PCI_MEM1_SIZE - 1,
            NULL, 0, EX_NOWAIT);
 
-       aprint_normal("%s: configuring PCI bus\n", sc->sc_dev.dv_xname);
+       aprint_normal("%s: configuring PCI bus\n", device_xname(sc->sc_dev));
        pci_configure_bus(pc, ioext, memext, NULL, 0, arm_dcache_align);
 
        extent_destroy(ioext);
@@ -146,7 +146,7 @@
 }
 
 void
-becc_pci_attach_hook(struct device *parent, struct device *self,
+becc_pci_attach_hook(device_t parent, device_t self,
     struct pcibus_attach_args *pba)
 {
 
diff -r 45e36453255f -r 81a8bdb5db95 sys/arch/arm/xscale/beccvar.h
--- a/sys/arch/arm/xscale/beccvar.h     Sun Oct 14 13:54:39 2012 +0000
+++ b/sys/arch/arm/xscale/beccvar.h     Sun Oct 14 14:20:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: beccvar.h,v 1.3 2003/03/25 19:47:30 thorpej Exp $      */
+/*     $NetBSD: beccvar.h,v 1.4 2012/10/14 14:20:57 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -63,7 +63,7 @@
 };
 
 struct becc_softc {
-       struct device sc_dev;           /* generic device glue */
+       device_t sc_dev;                /* generic device glue */
 
        /*
         * We expect the board-specific front-end to have already mapped
diff -r 45e36453255f -r 81a8bdb5db95 sys/arch/arm/xscale/i80312.c
--- a/sys/arch/arm/xscale/i80312.c      Sun Oct 14 13:54:39 2012 +0000
+++ b/sys/arch/arm/xscale/i80312.c      Sun Oct 14 14:20:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i80312.c,v 1.22 2012/09/18 05:47:28 matt Exp $ */
+/*     $NetBSD: i80312.c,v 1.23 2012/10/14 14:20:57 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i80312.c,v 1.22 2012/09/18 05:47:28 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80312.c,v 1.23 2012/10/14 14:20:57 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -109,17 +109,17 @@
        if (bus_space_subregion(sc->sc_st, sc->sc_sh, I80312_PPB_BASE,
            I80312_PPB_SIZE, &sc->sc_ppb_sh))
                panic("%s: unable to subregion PPB registers",
-                   sc->sc_dev.dv_xname);
+                   device_xname(sc->sc_dev));
 
        if (bus_space_subregion(sc->sc_st, sc->sc_sh, I80312_ATU_BASE,
            I80312_ATU_SIZE, &sc->sc_atu_sh))
                panic("%s: unable to subregion ATU registers",
-                   sc->sc_dev.dv_xname);
+                   device_xname(sc->sc_dev));
 
        if (bus_space_subregion(sc->sc_st, sc->sc_sh, I80312_INTC_BASE,
            I80312_INTC_SIZE, &sc->sc_intc_sh))
                panic("%s: unable to subregion INTC registers",
-                   sc->sc_dev.dv_xname);
+                   device_xname(sc->sc_dev));
 
        /* We expect the Memory Controller to be already sliced off. */
 
@@ -159,10 +159,10 @@
                    sc->sc_sder);
        } else if (sc->sc_privmem_size || sc->sc_privio_size) {
                printf("%s: WARNING: privmem_size 0x%08x privio_size 0x%08x\n",
-                   sc->sc_dev.dv_xname, sc->sc_privmem_size,
+                   device_xname(sc->sc_dev), sc->sc_privmem_size,
                    sc->sc_privio_size);
                printf("%s: private bus spaces not enabled\n",
-                   sc->sc_dev.dv_xname);
+                   device_xname(sc->sc_dev));
        }
 
        /*
@@ -296,7 +296,7 @@
                ia.ia_offset = id->id_offset;
                ia.ia_size = id->id_size;
 
-               (void) config_found_ia(&sc->sc_dev, "iopxs", &ia, i80312_iopxs_print);
+               (void) config_found_ia(sc->sc_dev, "iopxs", &ia, i80312_iopxs_print);
        }
 
        /*
@@ -319,7 +319,7 @@
        /* XXX MRL/MRM/MWI seem to have problems, at the moment. */
        pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY /* |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY */;
-       (void) config_found_ia(&sc->sc_dev, "pcibus", &pba, pcibusprint);
+       (void) config_found_ia(sc->sc_dev, "pcibus", &pba, pcibusprint);
 }
 
 /*
diff -r 45e36453255f -r 81a8bdb5db95 sys/arch/arm/xscale/i80312_pci.c
--- a/sys/arch/arm/xscale/i80312_pci.c  Sun Oct 14 13:54:39 2012 +0000
+++ b/sys/arch/arm/xscale/i80312_pci.c  Sun Oct 14 14:20:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i80312_pci.c,v 1.12 2012/09/07 03:05:12 matt Exp $     */
+/*     $NetBSD: i80312_pci.c,v 1.13 2012/10/14 14:20:57 msaitoh Exp $  */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i80312_pci.c,v 1.12 2012/09/07 03:05:12 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80312_pci.c,v 1.13 2012/10/14 14:20:57 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -61,7 +61,7 @@
 #include "opt_pci.h"
 #include "pci.h"
 
-void           i80312_pci_attach_hook(struct device *, struct device *,
+void           i80312_pci_attach_hook(device_t, device_t,
                    struct pcibus_attach_args *);
 int            i80312_pci_bus_maxdevs(void *, int);
 pcitag_t       i80312_pci_make_tag(void *, int, int, int);
@@ -115,7 +115,7 @@
            sc->sc_smemout_base + sc->sc_smemout_size - 1,
            NULL, 0, EX_NOWAIT);
 
-       aprint_normal("%s: configuring Secondary PCI bus\n", sc->sc_dev.dv_xname);
+       aprint_normal_dev(sc->sc_dev, "configuring Secondary PCI bus\n");
        pci_configure_bus(pc, ioext, memext, NULL, sbus, arm_dcache_align);
 
        extent_destroy(ioext);
@@ -129,7 +129,7 @@
 }
 
 void
-i80312_pci_attach_hook(struct device *parent, struct device *self,
+i80312_pci_attach_hook(device_t parent, device_t self,
     struct pcibus_attach_args *pba)
 {
 
diff -r 45e36453255f -r 81a8bdb5db95 sys/arch/arm/xscale/i80312var.h
--- a/sys/arch/arm/xscale/i80312var.h   Sun Oct 14 13:54:39 2012 +0000
+++ b/sys/arch/arm/xscale/i80312var.h   Sun Oct 14 14:20:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i80312var.h,v 1.10 2011/07/01 20:32:51 dyoung Exp $    */
+/*     $NetBSD: i80312var.h,v 1.11 2012/10/14 14:20:57 msaitoh Exp $   */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -43,7 +43,7 @@
 #include <dev/pci/pcivar.h>
 
 struct i80312_softc {
-       struct device sc_dev;           /* generic device glue */
+       device_t sc_dev;                /* generic device glue */
 
        int sc_is_host;                 /* indicates if we're a host or
                                           plugged into another host */
diff -r 45e36453255f -r 81a8bdb5db95 sys/arch/arm/xscale/i80321_pci.c
--- a/sys/arch/arm/xscale/i80321_pci.c  Sun Oct 14 13:54:39 2012 +0000
+++ b/sys/arch/arm/xscale/i80321_pci.c  Sun Oct 14 14:20:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i80321_pci.c,v 1.13 2012/09/07 03:05:12 matt Exp $     */
+/*     $NetBSD: i80321_pci.c,v 1.14 2012/10/14 14:20:57 msaitoh Exp $  */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i80321_pci.c,v 1.13 2012/09/07 03:05:12 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80321_pci.c,v 1.14 2012/10/14 14:20:57 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -62,7 +62,7 @@
 #include "opt_i80321.h"
 #include "pci.h"
 
-void           i80321_pci_attach_hook(struct device *, struct device *,
+void           i80321_pci_attach_hook(device_t, device_t,
                    struct pcibus_attach_args *);
 int            i80321_pci_bus_maxdevs(void *, int);
 pcitag_t       i80321_pci_make_tag(void *, int, int, int);
@@ -138,7 +138,7 @@
 }
 
 void
-i80321_pci_attach_hook(struct device *parent, struct device *self,
+i80321_pci_attach_hook(device_t parent, device_t self,
     struct pcibus_attach_args *pba)
 {
 
diff -r 45e36453255f -r 81a8bdb5db95 sys/arch/arm/xscale/ixp425.c
--- a/sys/arch/arm/xscale/ixp425.c      Sun Oct 14 13:54:39 2012 +0000
+++ b/sys/arch/arm/xscale/ixp425.c      Sun Oct 14 14:20:57 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ixp425.c,v 1.15 2011/07/01 20:32:51 dyoung Exp $ */
+/*     $NetBSD: ixp425.c,v 1.16 2012/10/14 14:20:57 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2003



Home | Main Index | Thread Index | Old Index