Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mips/atheros Cleanup machine includes



details:   https://anonhg.NetBSD.org/src/rev/b39236e55101
branches:  trunk
changeset: 767167:b39236e55101
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Jul 10 06:24:18 2011 +0000

description:
Cleanup machine includes

diffstat:

 sys/arch/mips/atheros/ar5315.c           |   6 ++--
 sys/arch/mips/atheros/ar5315_board.c     |   6 ++--
 sys/arch/mips/atheros/ar_intr.c          |  13 +++-------
 sys/arch/mips/atheros/dev/argpio.c       |  40 ++++++++++++++++----------------
 sys/arch/mips/atheros/dev/arspi.c        |  14 ++++------
 sys/arch/mips/atheros/dev/if_ae.c        |  23 ++++++++----------
 sys/arch/mips/atheros/dev/if_ath_arbus.c |  17 ++++++-------
 7 files changed, 54 insertions(+), 65 deletions(-)

diffs (truncated from 336 to 300 lines):

diff -r 0b231e7084c6 -r b39236e55101 sys/arch/mips/atheros/ar5315.c
--- a/sys/arch/mips/atheros/ar5315.c    Sun Jul 10 05:07:48 2011 +0000
+++ b/sys/arch/mips/atheros/ar5315.c    Sun Jul 10 06:24:18 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ar5315.c,v 1.8 2011/07/07 05:06:44 matt Exp $ */
+/* $NetBSD: ar5315.c,v 1.9 2011/07/10 06:24:18 matt Exp $ */
 
 /*
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -48,7 +48,7 @@
  * family.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ar5315.c,v 1.8 2011/07/07 05:06:44 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ar5315.c,v 1.9 2011/07/10 06:24:18 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -77,7 +77,7 @@
 #include <mips/atheros/include/platform.h>
 #include <mips/atheros/include/arbusvar.h>
 
-#include <machine/locore.h>
+#include <mips/locore.h>
 
 /* helper macro for accessing system registers without bus space */
 #define        REGVAL(x)       *((volatile uint32_t *)(MIPS_PHYS_TO_KSEG1((x))))
diff -r 0b231e7084c6 -r b39236e55101 sys/arch/mips/atheros/ar5315_board.c
--- a/sys/arch/mips/atheros/ar5315_board.c      Sun Jul 10 05:07:48 2011 +0000
+++ b/sys/arch/mips/atheros/ar5315_board.c      Sun Jul 10 06:24:18 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ar5315_board.c,v 1.3 2011/07/07 05:06:44 matt Exp $ */
+/* $NetBSD: ar5315_board.c,v 1.4 2011/07/10 06:24:18 matt Exp $ */
 
 /*
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -46,7 +46,7 @@
  * information data in flash for the AR5315.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ar5315_board.c,v 1.3 2011/07/07 05:06:44 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ar5315_board.c,v 1.4 2011/07/10 06:24:18 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -72,7 +72,7 @@
 #include <mips/atheros/include/arbusvar.h>
 #include <mips/atheros/include/platform.h>
 
-#include <machine/locore.h>
+#include <mips/locore.h>
 #include "com.h"
 
 /*
diff -r 0b231e7084c6 -r b39236e55101 sys/arch/mips/atheros/ar_intr.c
--- a/sys/arch/mips/atheros/ar_intr.c   Sun Jul 10 05:07:48 2011 +0000
+++ b/sys/arch/mips/atheros/ar_intr.c   Sun Jul 10 06:24:18 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ar_intr.c,v 1.2 2011/07/08 18:49:27 dyoung Exp $ */
+/* $NetBSD: ar_intr.c,v 1.3 2011/07/10 06:24:18 matt Exp $ */
 /*
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
  * Copyright (c) 2006 Garrett D'Amore.
@@ -41,19 +41,14 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ar_intr.c,v 1.2 2011/07/08 18:49:27 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ar_intr.c,v 1.3 2011/07/10 06:24:18 matt Exp $");
 
 #define __INTR_PRIVATE
 
 #include <sys/param.h>
-#include <sys/queue.h>
+#include <sys/intr.h>
+#include <sys/kernel.h>
 #include <sys/malloc.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-#include <sys/kernel.h>
-#include <sys/bus.h>
-
-#include <machine/intr.h>
 
 #include <mips/locore.h>
 #include <mips/atheros/include/platform.h>
diff -r 0b231e7084c6 -r b39236e55101 sys/arch/mips/atheros/dev/argpio.c
--- a/sys/arch/mips/atheros/dev/argpio.c        Sun Jul 10 05:07:48 2011 +0000
+++ b/sys/arch/mips/atheros/dev/argpio.c        Sun Jul 10 06:24:18 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: argpio.c,v 1.4 2011/07/01 18:40:00 dyoung Exp $ */
+/* $NetBSD: argpio.c,v 1.5 2011/07/10 06:24:19 matt Exp $ */
 
 /*-
  * Copyright (c) 2006 Garrett D'Amore
@@ -32,17 +32,16 @@
  */ 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: argpio.c,v 1.4 2011/07/01 18:40:00 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: argpio.c,v 1.5 2011/07/10 06:24:19 matt Exp $");
 
 #include <sys/param.h>
+#include <sys/bus.h>
 #include <sys/conf.h>
+#include <sys/device.h>
+#include <sys/gpio.h>
+#include <sys/intr.h>
 #include <sys/kernel.h>
 #include <sys/types.h>
-#include <sys/device.h>
-#include <sys/gpio.h>
-
-#include <sys/bus.h>
-#include <machine/intr.h>
 
 #include <mips/atheros/include/arbusvar.h>
 
@@ -60,7 +59,7 @@
  */
 
 struct argpio_softc {
-       struct device           sc_dev;
+       device_t                sc_dev;
        struct gpio_chipset_tag sc_gc;
        gpio_pin_t              sc_pins[ARGPIO_NPINS];
        int                     sc_npins;
@@ -74,15 +73,15 @@
        int                     sc_ledpin;
 };
 
-static int argpio_match(struct device *, struct cfdata *, void *);
-static void argpio_attach(struct device *, struct device *, void *);
+static int argpio_match(device_t, cfdata_t, void *);
+static void argpio_attach(device_t, device_t, void *);
 static int argpio_intr(void *);
 static void argpio_reset_pressed(void *);
 static void argpio_ctl(void *, int, int);
 static void argpio_write(void *, int, int);
 static int argpio_read(void *, int);
 
-CFATTACH_DECL(argpio, sizeof (struct argpio_softc), argpio_match,
+CFATTACH_DECL_NEW(argpio, sizeof (struct argpio_softc), argpio_match,
     argpio_attach, NULL, NULL);
 
 #define        INPUT(pin)      (1 << (pin))            /* input bit */
@@ -95,7 +94,7 @@
                                0, 12, BUS_SPACE_BARRIER_SYNC)
 
 int
-argpio_match(struct device *parent, struct cfdata *match, void *aux)
+argpio_match(device_t parent, cfdata_t match, void *aux)
 {
        struct arbus_attach_args *aa = aux;
 
@@ -103,15 +102,16 @@
 }
 
 void
-argpio_attach(struct device *parent, struct device *self, void *aux)
+argpio_attach(device_t parent, device_t self, void *aux)
 {
-       struct argpio_softc *sc = (struct argpio_softc *)self;
+       struct argpio_softc *sc = device_private(self);
        struct arbus_attach_args *aa = aux;
        struct gpiobus_attach_args gba;
        prop_number_t   pn;
        int i;
        uint32_t reg;
 
+       sc->sc_dev = self;
        sc->sc_st = aa->aa_bst;
        sc->sc_npins = ARGPIO_NPINS;
        sc->sc_size = aa->aa_size;
@@ -130,34 +130,34 @@
        sc->sc_gc.gp_pin_ctl = argpio_ctl;
 
        aprint_normal(": Atheros AR531X GPIO");
-       pn = prop_dictionary_get(device_properties(&sc->sc_dev), "reset-pin");
+       pn = prop_dictionary_get(device_properties(sc->sc_dev), "reset-pin");
        if (pn != NULL) {
                KASSERT(prop_object_type(pn) == PROP_TYPE_NUMBER);
                sc->sc_rstpin = (int)prop_number_integer_value(pn);
                aprint_normal(", reset button pin %d", sc->sc_rstpin);
        }
-       pn = prop_dictionary_get(device_properties(&sc->sc_dev), "sysled-pin");
+       pn = prop_dictionary_get(device_properties(sc->sc_dev), "sysled-pin");
        if (pn != NULL) {
                KASSERT(prop_object_type(pn) == PROP_TYPE_NUMBER);
                sc->sc_ledpin = (int)prop_number_integer_value(pn);
                aprint_normal(", system led pin %d", sc->sc_ledpin);
        }
 
-       printf("\n");
+       aprint_normal("\n");
 
        if (sc->sc_ledpin) {
                sc->sc_ih = arbus_intr_establish(aa->aa_cirq, aa->aa_mirq,
                    argpio_intr, sc);
                if (sc->sc_ih == NULL) {
-                       aprint_error("%s: couldn't establish interrupt\n",
-                           sc->sc_dev.dv_xname);
+                       aprint_error_dev(sc->sc_dev,
+                           "couldn't establish interrupt\n");
                }
        }
 
        if (sc->sc_ih) {
                sysmon_task_queue_init();
 
-               sc->sc_resetbtn.smpsw_name = sc->sc_dev.dv_xname;
+               sc->sc_resetbtn.smpsw_name = device_xname(sc->sc_dev);
                sc->sc_resetbtn.smpsw_type = PSWITCH_TYPE_RESET;
                if (sysmon_pswitch_register(&sc->sc_resetbtn) != 0)
                        printf("%s: unable to register reset button\n",
diff -r 0b231e7084c6 -r b39236e55101 sys/arch/mips/atheros/dev/arspi.c
--- a/sys/arch/mips/atheros/dev/arspi.c Sun Jul 10 05:07:48 2011 +0000
+++ b/sys/arch/mips/atheros/dev/arspi.c Sun Jul 10 06:24:18 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arspi.c,v 1.8 2011/07/07 05:06:44 matt Exp $ */
+/* $NetBSD: arspi.c,v 1.9 2011/07/10 06:24:19 matt Exp $ */
 
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,21 +42,19 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arspi.c,v 1.8 2011/07/07 05:06:44 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arspi.c,v 1.9 2011/07/10 06:24:19 matt Exp $");
 
 #include "locators.h"
 
 #include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
 #include <sys/device.h>
 #include <sys/errno.h>
+#include <sys/kernel.h>
 #include <sys/malloc.h>
 #include <sys/proc.h>
-#include <sys/queue.h>
-
-#include <sys/bus.h>
-#include <machine/cpu.h>
+#include <sys/systm.h>
 
 #include <mips/atheros/include/ar5315reg.h>
 #include <mips/atheros/include/arbusvar.h>
diff -r 0b231e7084c6 -r b39236e55101 sys/arch/mips/atheros/dev/if_ae.c
--- a/sys/arch/mips/atheros/dev/if_ae.c Sun Jul 10 05:07:48 2011 +0000
+++ b/sys/arch/mips/atheros/dev/if_ae.c Sun Jul 10 06:24:18 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: if_ae.c,v 1.20 2011/07/01 18:40:00 dyoung Exp $ */
+/* $Id: if_ae.c,v 1.21 2011/07/10 06:24:19 matt Exp $ */
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
  * Copyright (c) 2006 Garrett D'Amore.
@@ -98,21 +98,21 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ae.c,v 1.20 2011/07/01 18:40:00 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ae.c,v 1.21 2011/07/10 06:24:19 matt Exp $");
 
 
 #include <sys/param.h>
-#include <sys/systm.h>
+#include <sys/bus.h>
 #include <sys/callout.h>
+#include <sys/device.h>
+#include <sys/endian.h>
+#include <sys/errno.h>
+#include <sys/intr.h>
+#include <sys/ioctl.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
 #include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
 #include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/device.h>
-
-#include <machine/endian.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -123,9 +123,6 @@
 
 #include <net/bpf.h>
 
-#include <sys/bus.h>
-#include <machine/intr.h>
-
 #include <dev/mii/mii.h>
 #include <dev/mii/miivar.h>



Home | Main Index | Thread Index | Old Index