Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sbus Split device_t/softc.



details:   https://anonhg.NetBSD.org/src/rev/2210a5028ef2
branches:  trunk
changeset: 747520:2210a5028ef2
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Sep 19 04:48:18 2009 +0000

description:
Split device_t/softc.
Tested on:
---
qec0 at sbus0 slot 3 offset 0x20000: 128K memory
be0 at qec0 slot 0 offset 0x0 level 4 (ipl 7): rev 1, address 00:80:17:xx:xx:xx

diffstat:

 sys/dev/sbus/qec.c    |  9 +++++----
 sys/dev/sbus/qecvar.h |  4 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diffs (62 lines):

diff -r ba60f5b76416 -r 2210a5028ef2 sys/dev/sbus/qec.c
--- a/sys/dev/sbus/qec.c        Sat Sep 19 03:49:22 2009 +0000
+++ b/sys/dev/sbus/qec.c        Sat Sep 19 04:48:18 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: qec.c,v 1.48 2009/09/18 14:09:42 tsutsui Exp $ */
+/*     $NetBSD: qec.c,v 1.49 2009/09/19 04:48:18 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: qec.c,v 1.48 2009/09/18 14:09:42 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: qec.c,v 1.49 2009/09/19 04:48:18 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -67,7 +67,7 @@
                void *,                 /*arg*/
                void (*)(void));        /*optional fast trap handler*/
 
-CFATTACH_DECL(qec, sizeof(struct qec_softc),
+CFATTACH_DECL_NEW(qec, sizeof(struct qec_softc),
     qecmatch, qecattach, NULL, NULL);
 
 int
@@ -106,6 +106,7 @@
        bus_space_handle_t bh;
        int error;
 
+       sc->sc_dev = self;
        sc->sc_bustag = sa->sa_bustag;
        sc->sc_dmatag = sa->sa_dmatag;
        node = sa->sa_node;
@@ -239,7 +240,7 @@
                 */
                if (sc->sc_intr == NULL) {
                        printf("%s: warning: no interrupts\n",
-                               device_xname(&sc->sc_dev));
+                               device_xname(sc->sc_dev));
                        return (NULL);
                }
                pri = sc->sc_intr->oi_pri;
diff -r ba60f5b76416 -r 2210a5028ef2 sys/dev/sbus/qecvar.h
--- a/sys/dev/sbus/qecvar.h     Sat Sep 19 03:49:22 2009 +0000
+++ b/sys/dev/sbus/qecvar.h     Sat Sep 19 04:48:18 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: qecvar.h,v 1.13 2009/09/18 14:09:42 tsutsui Exp $      */
+/*     $NetBSD: qecvar.h,v 1.14 2009/09/19 04:48:18 tsutsui Exp $      */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 struct qec_softc {
-       struct device sc_dev;           /* us as a device */
+       device_t sc_dev;                /* us as a device */
        bus_space_tag_t sc_bustag;      /* bus & DMA tags */
        bus_dma_tag_t   sc_dmatag;
        struct  openprom_intr *sc_intr; /* interrupt info */



Home | Main Index | Thread Index | Old Index