summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authortsutsui <tsutsui@NetBSD.org>2009-09-18 16:43:19 +0000
committertsutsui <tsutsui@NetBSD.org>2009-09-18 16:43:19 +0000
commit853e246fe13af38e29fbae92cd6fd0d8aac6ab4c (patch)
treeab3f639586f84a4cd23cc616703cbf50f482b639 /sys/dev
parenta29a5a76597997aca8afc35cda586c7ab69bbab0 (diff)
Split device_t/softc. Tested on SS1+.
XXX: sparc/dev/cgthree.c in Attic had an attachment for cgthree* at obio? XXX: and sparc/conf/files.sparc still has an entry of nonexistent (or not yet) XXX: sparc/dev/cgthree_obio.c. Is there any sun4m machine which requires it?
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sbus/cgthree_sbus.c8
-rw-r--r--sys/dev/sun/cgthree.c11
-rw-r--r--sys/dev/sun/cgthreevar.h4
3 files changed, 13 insertions, 10 deletions
diff --git a/sys/dev/sbus/cgthree_sbus.c b/sys/dev/sbus/cgthree_sbus.c
index a32abf5b401..98e8fb4546b 100644
--- a/sys/dev/sbus/cgthree_sbus.c
+++ b/sys/dev/sbus/cgthree_sbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cgthree_sbus.c,v 1.28 2009/09/18 12:23:16 tsutsui Exp $ */
+/* $NetBSD: cgthree_sbus.c,v 1.29 2009/09/18 16:43:19 tsutsui Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgthree_sbus.c,v 1.28 2009/09/18 12:23:16 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgthree_sbus.c,v 1.29 2009/09/18 16:43:19 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -108,7 +108,7 @@ __KERNEL_RCSID(0, "$NetBSD: cgthree_sbus.c,v 1.28 2009/09/18 12:23:16 tsutsui Ex
static int cgthreematch_sbus(device_t, cfdata_t, void *);
static void cgthreeattach_sbus(device_t, device_t, void *);
-CFATTACH_DECL(cgthree_sbus, sizeof(struct cgthree_softc),
+CFATTACH_DECL_NEW(cgthree_sbus, sizeof(struct cgthree_softc),
cgthreematch_sbus, cgthreeattach_sbus, NULL, NULL);
/*
@@ -139,6 +139,8 @@ cgthreeattach_sbus(device_t parent, device_t self, void *args)
const char *name;
bus_space_handle_t bh;
+ sc->sc_dev = self;
+
/* Remember cookies for cgthree_mmap() */
sc->sc_bustag = sa->sa_bustag;
sc->sc_paddr = sbus_bus_addr(sa->sa_bustag, sa->sa_slot, sa->sa_offset);
diff --git a/sys/dev/sun/cgthree.c b/sys/dev/sun/cgthree.c
index ceee9f42455..09c033d478c 100644
--- a/sys/dev/sun/cgthree.c
+++ b/sys/dev/sun/cgthree.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cgthree.c,v 1.23 2009/05/12 14:46:39 cegger Exp $ */
+/* $NetBSD: cgthree.c,v 1.24 2009/09/18 16:43:19 tsutsui Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.23 2009/05/12 14:46:39 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.24 2009/09/18 16:43:19 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -257,7 +257,7 @@ cgthreeattach(struct cgthree_softc *sc, const char *name, int isconsole)
aa.console = isconsole;
aa.accessops = &cgthree_accessops;
aa.accesscookie = &sc->vd;
- config_found(&sc->sc_dev, &aa, wsemuldisplaydevprint);
+ config_found(sc->sc_dev, &aa, wsemuldisplaydevprint);
#else
/* Initialize the default color map. */
bt_initcmap(&sc->sc_cmap, 256);
@@ -336,10 +336,11 @@ cgthreeioctl(dev_t dev, u_long cmd, void *data, int flags, struct lwp *l)
* Undo the effect of an FBIOSVIDEO that turns the video off.
*/
static void
-cgthreeunblank(device_t dev)
+cgthreeunblank(device_t self)
{
+ struct cgthree_softc *sc = device_private(self);
- cgthree_set_video(device_private(dev), 1);
+ cgthree_set_video(sc, 1);
}
static void
diff --git a/sys/dev/sun/cgthreevar.h b/sys/dev/sun/cgthreevar.h
index dda1534aaf7..92ed6fa9987 100644
--- a/sys/dev/sun/cgthreevar.h
+++ b/sys/dev/sun/cgthreevar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: cgthreevar.h,v 1.7 2009/02/23 22:44:27 jdc Exp $ */
+/* $NetBSD: cgthreevar.h,v 1.8 2009/09/18 16:43:19 tsutsui Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
/* per-display variables */
struct cgthree_softc {
- struct device sc_dev; /* base device */
+ device_t sc_dev; /* base device */
struct fbdevice sc_fb; /* frame buffer device */
bus_space_tag_t sc_bustag;
bus_addr_t sc_paddr; /* phys address for device mmap() */