Module Name: src
Committed By: tsutsui
Date: Tue Jan 25 13:31:42 UTC 2011
Modified Files:
src/sys/arch/sgimips/hpc: haltwo.c haltwovar.h
Log Message:
Split device_t/softc. Tested on Indy.
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/sgimips/hpc/haltwo.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sgimips/hpc/haltwovar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sgimips/hpc/haltwo.c
diff -u src/sys/arch/sgimips/hpc/haltwo.c:1.18 src/sys/arch/sgimips/hpc/haltwo.c:1.19
--- src/sys/arch/sgimips/hpc/haltwo.c:1.18 Tue Jan 25 12:21:04 2011
+++ src/sys/arch/sgimips/hpc/haltwo.c Tue Jan 25 13:31:41 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: haltwo.c,v 1.18 2011/01/25 12:21:04 tsutsui Exp $ */
+/* $NetBSD: haltwo.c,v 1.19 2011/01/25 13:31:41 tsutsui Exp $ */
/*
* Copyright (c) 2003 Ilpo Ruotsalainen
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: haltwo.c,v 1.18 2011/01/25 12:21:04 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: haltwo.c,v 1.19 2011/01/25 13:31:41 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -113,11 +113,11 @@
"haltwo"
};
-static int haltwo_match(struct device *, struct cfdata *, void *);
-static void haltwo_attach(struct device *, struct device *, void *);
+static int haltwo_match(device_t, cfdata_t, void *);
+static void haltwo_attach(device_t, device_t, void *);
static int haltwo_intr(void *);
-CFATTACH_DECL(haltwo, sizeof(struct haltwo_softc),
+CFATTACH_DECL_NEW(haltwo, sizeof(struct haltwo_softc),
haltwo_match, haltwo_attach, NULL, NULL);
#define haltwo_write(sc,type,off,val) \
@@ -259,7 +259,7 @@
}
static int
-haltwo_match(struct device *parent, struct cfdata *cf, void *aux)
+haltwo_match(device_t parent, cfdata_t cf, void *aux)
{
struct hpc_attach_args *haa;
uint32_t rev;
@@ -288,14 +288,15 @@
}
static void
-haltwo_attach(struct device *parent, struct device *self, void *aux)
+haltwo_attach(device_t parent, device_t self, void *aux)
{
struct haltwo_softc *sc;
struct hpc_attach_args *haa;
uint32_t rev;
- sc = (void *)self;
+ sc = device_private(self);
haa = aux;
+ sc->sc_dev = self;
sc->sc_st = haa->ha_st;
sc->sc_dma_tag = haa->ha_dmat;
@@ -356,7 +357,7 @@
haltwo_write(sc, vol, HAL2_REG_VOL_LEFT, sc->sc_vol_left);
haltwo_write(sc, vol, HAL2_REG_VOL_RIGHT, sc->sc_vol_right);
- audio_attach_mi(&haltwo_hw_if, sc, &sc->sc_dev);
+ audio_attach_mi(&haltwo_hw_if, sc, self);
if (!pmf_device_register1(self, NULL, NULL, haltwo_shutdown))
aprint_error_dev(self,
Index: src/sys/arch/sgimips/hpc/haltwovar.h
diff -u src/sys/arch/sgimips/hpc/haltwovar.h:1.6 src/sys/arch/sgimips/hpc/haltwovar.h:1.7
--- src/sys/arch/sgimips/hpc/haltwovar.h:1.6 Thu Sep 24 14:09:18 2009
+++ src/sys/arch/sgimips/hpc/haltwovar.h Tue Jan 25 13:31:41 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: haltwovar.h,v 1.6 2009/09/24 14:09:18 tsutsui Exp $ */
+/* $NetBSD: haltwovar.h,v 1.7 2011/01/25 13:31:41 tsutsui Exp $ */
/*
* Copyright (c) 2003 Ilpo Ruotsalainen
@@ -60,7 +60,7 @@
};
struct haltwo_softc {
- struct device sc_dev;
+ device_t sc_dev;
bus_space_tag_t sc_st;