Module Name: src
Committed By: skrll
Date: Mon May 14 10:38:09 UTC 2012
Modified Files:
src/sys/arch/arm/iomd: iomd.c iomd_clock.c iomdiic.c iomdkbc.c qms.c
vidc20.c vidcaudio.c vidcvideo.c
Log Message:
device_t/softc split
struct device * -> device_t
struct cfdata * -> cfdata_t
Use aprint*
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/iomd/iomd.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/iomd/iomd_clock.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/iomd/iomdiic.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/iomd/iomdkbc.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/iomd/qms.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/iomd/vidc20.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/arm/iomd/vidcaudio.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/arm/iomd/vidcvideo.c
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/arm/iomd/iomd.c
diff -u src/sys/arch/arm/iomd/iomd.c:1.18 src/sys/arch/arm/iomd/iomd.c:1.19
--- src/sys/arch/arm/iomd/iomd.c:1.18 Thu May 10 09:56:27 2012
+++ src/sys/arch/arm/iomd/iomd.c Mon May 14 10:38:08 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: iomd.c,v 1.18 2012/05/10 09:56:27 skrll Exp $ */
+/* $NetBSD: iomd.c,v 1.19 2012/05/14 10:38:08 skrll Exp $ */
/*
* Copyright (c) 1996-1997 Mark Brinicombe.
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iomd.c,v 1.18 2012/05/10 09:56:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iomd.c,v 1.19 2012/05/14 10:38:08 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -74,19 +74,17 @@ __KERNEL_RCSID(0, "$NetBSD: iomd.c,v 1.1
*/
struct iomd_softc {
- struct device sc_dev; /* device node */
+ device_t sc_dev; /* device node */
bus_space_tag_t sc_iot; /* bus tag */
bus_space_handle_t sc_ioh; /* bus handle */
int sc_id; /* IOMD id */
};
-static int iomdmatch(struct device *parent, struct cfdata *cf,
- void *aux);
-static void iomdattach(struct device *parent, struct device *self,
- void *aux);
+static int iomdmatch(device_t parent, cfdata_t cf, void *aux);
+static void iomdattach(device_t parent, device_t self, void *aux);
static int iomdprint(void *aux, const char *iomdbus);
-CFATTACH_DECL(iomd, sizeof(struct iomd_softc),
+CFATTACH_DECL_NEW(iomd, sizeof(struct iomd_softc),
iomdmatch, iomdattach, NULL, NULL);
extern struct bus_space iomd_bs_tag;
@@ -115,13 +113,13 @@ iomdprint(void *aux, const char *name)
}
/*
- * int iomdmatch(struct device *parent, struct cfdata *cf, void *aux)
+ * int iomdmatch(device_t parent, cfdata_t cf, void *aux)
*
* Just return ok for this if it is device 0
*/
static int
-iomdmatch(struct device *parent, struct cfdata *cf, void *aux)
+iomdmatch(device_t parent, cfdata_t cf, void *aux)
{
if (iomd_found)
@@ -131,16 +129,16 @@ iomdmatch(struct device *parent, struct
/*
- * void iomdattach(struct device *parent, struct device *dev, void *aux)
+ * void iomdattach(device_t parent, device_t dev, void *aux)
*
* Map the IOMD and identify it.
* Then configure the child devices based on the IOMD ID.
*/
static void
-iomdattach(struct device *parent, struct device *self, void *aux)
+iomdattach(device_t parent, device_t self, void *aux)
{
- struct iomd_softc *sc = (struct iomd_softc *)self;
+ struct iomd_softc *sc = device_private(self);
/* struct mainbus_attach_args *mb = aux;*/
int refresh;
#if 0
@@ -153,6 +151,7 @@ iomdattach(struct device *parent, struct
/* There can be only 1 IOMD. */
iomd_found = 1;
+ sc->sc_dev = self;
iot = sc->sc_iot = &iomd_bs_tag;
/* Map the IOMD */
@@ -164,75 +163,75 @@ iomdattach(struct device *parent, struct
/* Get the ID */
sc->sc_id = bus_space_read_1(iot, ioh, IOMD_ID0)
| (bus_space_read_1(iot, ioh, IOMD_ID1) << 8);
- printf(": ");
+ aprint_normal(": ");
/* Identify it and get the DRAM refresh rate */
switch (sc->sc_id) {
case ARM7500_IOC_ID:
- printf("ARM7500 IOMD ");
+ aprint_normal("ARM7500 IOMD ");
refresh = bus_space_read_1(iot, ioh, IOMD_REFCR) & 0x0f;
arm7500_ioc_found = 1;
break;
case ARM7500FE_IOC_ID:
- printf("ARM7500FE IOMD ");
+ aprint_normal("ARM7500FE IOMD ");
refresh = bus_space_read_1(iot, ioh, IOMD_REFCR) & 0x0f;
arm7500_ioc_found = 1;
break;
case RPC600_IOMD_ID:
- printf("IOMD20 ");
+ aprint_normal("IOMD20 ");
refresh = bus_space_read_1(iot, ioh, IOMD_VREFCR) & 0x09;
arm7500_ioc_found = 0;
break;
default:
- printf("Unknown IOMD ID=%04x ", sc->sc_id);
+ aprint_normal("Unknown IOMD ID=%04x ", sc->sc_id);
refresh = -1;
arm7500_ioc_found = 0; /* just in case */
break;
}
- printf("version %d\n", bus_space_read_1(iot, ioh, IOMD_VERSION));
+ aprint_normal("version %d\n", bus_space_read_1(iot, ioh, IOMD_VERSION));
/* Report the DRAM refresh rate */
- printf("%s: ", self->dv_xname);
- printf("DRAM refresh=");
+ aprint_normal("%s: ", self->dv_xname);
+ aprint_normal("DRAM refresh=");
switch (refresh) {
case 0x0:
- printf("off");
+ aprint_normal("off");
break;
case 0x1:
- printf("16us");
+ aprint_normal("16us");
break;
case 0x2:
- printf("32us");
+ aprint_normal("32us");
break;
case 0x4:
- printf("64us");
+ aprint_normal("64us");
break;
case 0x8:
- printf("128us");
+ aprint_normal("128us");
break;
default:
- printf("unknown [%02x]", refresh);
+ aprint_normal("unknown [%02x]", refresh);
break;
}
- printf("\n");
+ aprint_normal("\n");
#if 0
/*
* No point in reporting this as it may get changed when devices are
* attached
*/
tmp = bus_space_read_1(iot, ioh, IOMD_IOTCR);
- printf("%s: I/O timings: combo %c, NPCCS1/2 %c", self->dv_xname,
+ aprint_normal("%s: I/O timings: combo %c, NPCCS1/2 %c", self->dv_xname,
'A' + ((tmp >>2) & 3), 'A' + (tmp & 3));
tmp = bus_space_read_1(iot, ioh, IOMD_ECTCR);
- printf(", EASI ");
+ aprint_normal(", EASI ");
for (i = 0; i < 8; i++, tmp >>= 1)
- printf("%c", 'A' + ((tmp & 1) << 2));
+ aprint_normal("%c", 'A' + ((tmp & 1) << 2));
tmp = bus_space_read_1(iot, ioh, IOMD_DMATCR);
- printf(", DMA ");
+ aprint_normal(", DMA ");
for (i = 0; i < 4; i++, tmp >>= 2)
- printf("%c", 'A' + (tmp & 3));
- printf("\n");
+ aprint_normal("%c", 'A' + (tmp & 3));
+ aprint_normal("\n");
#endif
/* Set up the external DMA channels */
Index: src/sys/arch/arm/iomd/iomd_clock.c
diff -u src/sys/arch/arm/iomd/iomd_clock.c:1.26 src/sys/arch/arm/iomd/iomd_clock.c:1.27
--- src/sys/arch/arm/iomd/iomd_clock.c:1.26 Sat Feb 18 23:51:27 2012
+++ src/sys/arch/arm/iomd/iomd_clock.c Mon May 14 10:38:08 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: iomd_clock.c,v 1.26 2012/02/18 23:51:27 rmind Exp $ */
+/* $NetBSD: iomd_clock.c,v 1.27 2012/05/14 10:38:08 skrll Exp $ */
/*
* Copyright (c) 1994-1997 Mark Brinicombe.
@@ -47,7 +47,7 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: iomd_clock.c,v 1.26 2012/02/18 23:51:27 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iomd_clock.c,v 1.27 2012/05/14 10:38:08 skrll Exp $");
#include <sys/systm.h>
#include <sys/types.h>
@@ -65,7 +65,7 @@ __KERNEL_RCSID(0, "$NetBSD: iomd_clock.c
#include <arm/iomd/iomdreg.h>
struct clock_softc {
- struct device sc_dev;
+ device_t sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
};
@@ -78,8 +78,8 @@ static void *statclockirq;
static struct clock_softc *clock_sc;
static int timer0_count;
-static int clockmatch(struct device *parent, struct cfdata *cf, void *aux);
-static void clockattach(struct device *parent, struct device *self, void *aux);
+static int clockmatch(device_t parent, cfdata_t cf, void *aux);
+static void clockattach(device_t parent, device_t self, void *aux);
#ifdef DIAGNOSTIC
static void checkdelay(void);
#endif
@@ -106,17 +106,17 @@ static struct timecounter iomd_timecount
int clockhandler(void *);
int statclockhandler(void *);
-CFATTACH_DECL(clock, sizeof(struct clock_softc),
+CFATTACH_DECL_NEW(clock, sizeof(struct clock_softc),
clockmatch, clockattach, NULL, NULL);
/*
- * int clockmatch(struct device *parent, void *match, void *aux)
+ * int clockmatch(device_t parent, void *match, void *aux)
*
* Just return ok for this if it is device 0
*/
static int
-clockmatch(struct device *parent, struct cfdata *cf, void *aux)
+clockmatch(device_t parent, cfdata_t cf, void *aux)
{
struct clk_attach_args *ca = aux;
@@ -127,18 +127,19 @@ clockmatch(struct device *parent, struct
/*
- * void clockattach(struct device *parent, struct device *dev, void *aux)
+ * void clockattach(device_t parent, device_t dev, void *aux)
*
* Map the IOMD and identify it.
* Then configure the child devices based on the IOMD ID.
*/
static void
-clockattach(struct device *parent, struct device *self, void *aux)
+clockattach(device_t parent, device_t self, void *aux)
{
- struct clock_softc *sc = (struct clock_softc *)self;
+ struct clock_softc *sc = device_private(self);
struct clk_attach_args *ca = aux;
+ sc->sc_dev = self;
sc->sc_iot = ca->ca_iot;
sc->sc_ioh = ca->ca_ioh; /* This is a handle for the whole IOMD */
@@ -146,7 +147,7 @@ clockattach(struct device *parent, struc
/* Cannot do anything until cpu_initclocks() has been called */
- printf("\n");
+ aprint_normal("\n");
}
@@ -218,7 +219,7 @@ setstatclockrate(int newhz)
count = TIMER_FREQUENCY / newhz;
- printf("Setting statclock to %dHz (%d ticks)\n", newhz, count);
+ aprint_normal("Setting statclock to %dHz (%d ticks)\n", newhz, count);
bus_space_write_1(clock_sc->sc_iot, clock_sc->sc_ioh,
IOMD_T1LOW, (count >> 0) & 0xff);
@@ -246,7 +247,7 @@ checkdelay(void)
return;
if (diff.tv_usec > 10000)
return;
- printf("WARNING: delay(10000) took %d us\n", diff.tv_usec);
+ aprint_normal("WARNING: delay(10000) took %d us\n", diff.tv_usec);
}
#endif
@@ -267,7 +268,7 @@ cpu_initclocks(void)
* This timer generates 100Hz interrupts for the system clock
*/
- printf("clock: hz=%d stathz = %d profhz = %d\n", hz, stathz, profhz);
+ aprint_normal("clock: hz=%d stathz = %d profhz = %d\n", hz, stathz, profhz);
timer0_count = TIMER_FREQUENCY / hz;
@@ -286,7 +287,7 @@ cpu_initclocks(void)
if (clockirq == NULL)
panic("%s: Cannot installer timer 0 IRQ handler",
- clock_sc->sc_dev.dv_xname);
+ device_xname(clock_sc->sc_dev));
if (stathz) {
setstatclockrate(stathz);
@@ -294,7 +295,7 @@ cpu_initclocks(void)
"tmr1 stat clk", statclockhandler, 0);
if (statclockirq == NULL)
panic("%s: Cannot installer timer 1 IRQ handler",
- clock_sc->sc_dev.dv_xname);
+ device_xname(clock_sc->sc_dev));
}
#ifdef DIAGNOSTIC
checkdelay();
Index: src/sys/arch/arm/iomd/iomdiic.c
diff -u src/sys/arch/arm/iomd/iomdiic.c:1.6 src/sys/arch/arm/iomd/iomdiic.c:1.7
--- src/sys/arch/arm/iomd/iomdiic.c:1.6 Thu Dec 6 17:00:31 2007
+++ src/sys/arch/arm/iomd/iomdiic.c Mon May 14 10:38:08 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: iomdiic.c,v 1.6 2007/12/06 17:00:31 ad Exp $ */
+/* $NetBSD: iomdiic.c,v 1.7 2012/05/14 10:38:08 skrll Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -52,7 +52,7 @@
#include <arm/iomd/iomdiicvar.h>
struct iomdiic_softc {
- struct device sc_dev;
+ device_t sc_dev;
bus_space_tag_t sc_st;
bus_space_handle_t sc_sh;
@@ -118,7 +118,7 @@ static const struct i2c_bitbang_ops iomd
};
static int
-iomdiic_match(struct device *parent, struct cfdata *cf, void *aux)
+iomdiic_match(device_t parent, cfdata_t cf, void *aux)
{
struct iic_attach_args *ia = aux;
@@ -127,12 +127,14 @@ iomdiic_match(struct device *parent, str
}
static void
-iomdiic_attach(struct device *parent, struct device *self, void *aux)
+iomdiic_attach(device_t parent, device_t self, void *aux)
{
- struct iomdiic_softc *sc = (void *) self;
+ struct iomdiic_softc *sc = device_private(self);
struct i2cbus_attach_args iba;
- printf("\n");
+ aprint_normal("\n");
+
+ sc->sc_dev = self;
mutex_init(&sc->sc_buslock, MUTEX_DEFAULT, IPL_NONE);
@@ -146,20 +148,22 @@ iomdiic_attach(struct device *parent, st
sc->sc_i2c.ic_write_byte = iomdiic_write_byte;
iba.iba_tag = &sc->sc_i2c;
- (void) config_found_ia(&sc->sc_dev, "i2cbus", &iba, iicbus_print);
+ (void) config_found_ia(sc->sc_dev, "i2cbus", &iba, iicbus_print);
}
-CFATTACH_DECL(iomdiic, sizeof(struct iomdiic_softc),
+CFATTACH_DECL_NEW(iomdiic, sizeof(struct iomdiic_softc),
iomdiic_match, iomdiic_attach, NULL, NULL);
i2c_tag_t
iomdiic_bootstrap_cookie(void)
{
static struct iomdiic_softc sc;
+ static struct device dev;
/* XXX Yuck. */
- strcpy(sc.sc_dev.dv_xname, "iomdiicboot");
+ strcpy(dev.dv_xname, "iomdiicboot");
+ sc.sc_dev = &dev;
sc.sc_i2c.ic_cookie = ≻
sc.sc_i2c.ic_acquire_bus = iomdiic_acquire_bus;
sc.sc_i2c.ic_release_bus = iomdiic_release_bus;
Index: src/sys/arch/arm/iomd/iomdkbc.c
diff -u src/sys/arch/arm/iomd/iomdkbc.c:1.4 src/sys/arch/arm/iomd/iomdkbc.c:1.5
--- src/sys/arch/arm/iomd/iomdkbc.c:1.4 Fri Jul 1 20:26:35 2011
+++ src/sys/arch/arm/iomd/iomdkbc.c Mon May 14 10:38:08 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: iomdkbc.c,v 1.4 2011/07/01 20:26:35 dyoung Exp $ */
+/* $NetBSD: iomdkbc.c,v 1.5 2012/05/14 10:38:08 skrll Exp $ */
/*-
* Copyright (c) 2004 Ben Harris
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iomdkbc.c,v 1.4 2011/07/01 20:26:35 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iomdkbc.c,v 1.5 2012/05/14 10:38:08 skrll Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -61,7 +61,7 @@ __KERNEL_RCSID(0, "$NetBSD: iomdkbc.c,v
#define KBC_DEVCMD_RESEND 0xfe
struct iomdkbc_softc {
- struct device sc_dev;
+ device_t sc_dev;
struct iomdkbc_internal *sc_id;
};
@@ -77,8 +77,8 @@ struct iomdkbc_internal {
int t_rxirq[PCKBPORT_NSLOTS];
};
-static int iomdkbc_match(struct device *, struct cfdata *, void *);
-static void iomdkbc_attach(struct device *, struct device *, void *);
+static int iomdkbc_match(device_t , cfdata_t , void *);
+static void iomdkbc_attach(device_t , device_t , void *);
static int iomdkbc_xt_translation(void *, pckbport_slot_t, int);
static int iomdkbc_send_devcmd(void *, pckbport_slot_t, u_char);
@@ -89,7 +89,7 @@ static void iomdkbc_set_poll(void *, pck
static int iomdkbc_intr(void *);
-CFATTACH_DECL(iomdkbc, sizeof(struct iomdkbc_softc),
+CFATTACH_DECL_NEW(iomdkbc, sizeof(struct iomdkbc_softc),
iomdkbc_match, iomdkbc_attach, NULL, NULL);
static struct pckbport_accessops const iomdkbc_ops = {
@@ -104,7 +104,7 @@ static struct pckbport_accessops const i
static struct iomdkbc_internal iomdkbc_cntag;
static int
-iomdkbc_match(struct device *parent, struct cfdata *cf, void *aux)
+iomdkbc_match(device_t parent, cfdata_t cf, void *aux)
{
struct kbd_attach_args *ka = aux;
struct opms_attach_args *pa = aux;
@@ -116,14 +116,15 @@ iomdkbc_match(struct device *parent, str
}
static void
-iomdkbc_attach(struct device *parent, struct device *self, void *aux)
+iomdkbc_attach(device_t parent, device_t self, void *aux)
{
struct kbd_attach_args *ka = aux;
struct opms_attach_args *pa = aux;
- struct iomdkbc_softc *sc = (struct iomdkbc_softc *)self;
+ struct iomdkbc_softc *sc = device_private(self);
struct iomdkbc_internal *t;
- printf("\n");
+ sc->sc_dev = self;
+ aprint_normal("\n");
t = NULL;
if (strcmp(ka->ka_name, "kbd") == 0) {
@@ -143,13 +144,13 @@ iomdkbc_attach(struct device *parent, st
t->t_ioh[PCKBPORT_KBD_SLOT] = ka->ka_ioh;
}
t->t_rxih[PCKBPORT_KBD_SLOT] = intr_claim(ka->ka_rxirq,
- IPL_TTY, sc->sc_dev.dv_xname, iomdkbc_intr, t);
+ IPL_TTY, device_xname(sc->sc_dev), iomdkbc_intr, t);
t->t_rxirq[PCKBPORT_KBD_SLOT] = ka->ka_rxirq;
disable_irq(t->t_rxirq[PCKBPORT_KBD_SLOT]);
sc->sc_id = t;
t->t_sc = sc;
t->t_pt = pckbport_attach(t, &iomdkbc_ops);
- pckbport_attach_slot(&sc->sc_dev, t->t_pt, PCKBPORT_KBD_SLOT);
+ pckbport_attach_slot(sc->sc_dev, t->t_pt, PCKBPORT_KBD_SLOT);
}
if (strcmp(pa->pa_name, "opms") == 0) {
@@ -165,14 +166,14 @@ iomdkbc_attach(struct device *parent, st
t->t_iot = pa->pa_iot;
t->t_ioh[PCKBPORT_AUX_SLOT] = pa->pa_ioh;
t->t_rxih[PCKBPORT_AUX_SLOT] = intr_claim(pa->pa_irq,
- IPL_TTY, sc->sc_dev.dv_xname, iomdkbc_intr, t);
+ IPL_TTY, device_xname(sc->sc_dev), iomdkbc_intr, t);
t->t_rxirq[PCKBPORT_AUX_SLOT] = pa->pa_irq;
disable_irq(t->t_rxirq[PCKBPORT_AUX_SLOT]);
sc->sc_id = t;
t->t_sc = sc;
if (t->t_pt == NULL)
t->t_pt = pckbport_attach(t, &iomdkbc_ops);
- pckbport_attach_slot(&sc->sc_dev, t->t_pt, PCKBPORT_AUX_SLOT);
+ pckbport_attach_slot(sc->sc_dev, t->t_pt, PCKBPORT_AUX_SLOT);
}
}
Index: src/sys/arch/arm/iomd/qms.c
diff -u src/sys/arch/arm/iomd/qms.c:1.17 src/sys/arch/arm/iomd/qms.c:1.18
--- src/sys/arch/arm/iomd/qms.c:1.17 Thu May 10 09:56:27 2012
+++ src/sys/arch/arm/iomd/qms.c Mon May 14 10:38:08 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: qms.c,v 1.17 2012/05/10 09:56:27 skrll Exp $ */
+/* $NetBSD: qms.c,v 1.18 2012/05/14 10:38:08 skrll Exp $ */
/*-
* Copyright (c) 2001 Reinoud Zandijk
@@ -41,7 +41,7 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: qms.c,v 1.17 2012/05/10 09:56:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: qms.c,v 1.18 2012/05/14 10:38:08 skrll Exp $");
#include <sys/callout.h>
#include <sys/device.h>
@@ -65,8 +65,8 @@ __KERNEL_RCSID(0, "$NetBSD: qms.c,v 1.17
#include <dev/wscons/wsmousevar.h>
struct qms_softc {
- struct device sc_dev;
- struct device *sc_wsmousedev;
+ device_t sc_dev;
+ device_t sc_wsmousedev;
bus_space_tag_t sc_iot; /* bus tag */
bus_space_handle_t sc_ioh; /* bus handle for XY */
@@ -84,15 +84,15 @@ struct qms_softc {
#define QMS_MOUSEY 1 /* 16 bits Y register */
#define QMS_BUTTONS 0 /* mouse buttons in bits 4,5,6 */
-static int qms_match(struct device *, struct cfdata *, void *);
-static void qms_attach(struct device *, struct device *, void *);
+static int qms_match(device_t , cfdata_t , void *);
+static void qms_attach(device_t , device_t , void *);
static int qms_enable(void *);
static int qms_ioctl(void *, u_long, void *, int, struct lwp *);
static void qms_disable(void *cookie);
static void qms_intr(void *arg);
-CFATTACH_DECL(qms, sizeof(struct qms_softc),
+CFATTACH_DECL_NEW(qms, sizeof(struct qms_softc),
qms_match, qms_attach, NULL, NULL);
static struct wsmouse_accessops qms_accessops = {
@@ -101,7 +101,7 @@ static struct wsmouse_accessops qms_acce
static int
-qms_match(struct device *parent, struct cfdata *cf, void *aux)
+qms_match(device_t parent, cfdata_t cf, void *aux)
{
struct qms_attach_args *qa = aux;
@@ -113,12 +113,13 @@ qms_match(struct device *parent, struct
static void
-qms_attach(struct device *parent, struct device *self, void *aux)
+qms_attach(device_t parent, device_t self, void *aux)
{
- struct qms_softc *sc = (void *)self;
+ struct qms_softc *sc = device_private(self);
struct qms_attach_args *qa = aux;
struct wsmousedev_attach_args wsmouseargs;
+ sc->sc_dev = self;
sc->sc_iot = qa->qa_iot;
sc->sc_ioh = qa->qa_ioh;
sc->sc_butioh = qa->qa_ioh_but;
@@ -127,10 +128,10 @@ qms_attach(struct device *parent, struct
wsmouseargs.accessops = &qms_accessops;
wsmouseargs.accesscookie = sc;
- printf("\n");
+ aprint_normal("\n");
sc->sc_wsmousedev =
- config_found(&sc->sc_dev, &wsmouseargs, wsmousedevprint);
+ config_found(sc->sc_dev, &wsmouseargs, wsmousedevprint);
callout_init(&sc->sc_callout, 0);
}
Index: src/sys/arch/arm/iomd/vidc20.c
diff -u src/sys/arch/arm/iomd/vidc20.c:1.16 src/sys/arch/arm/iomd/vidc20.c:1.17
--- src/sys/arch/arm/iomd/vidc20.c:1.16 Fri Jul 1 20:26:35 2011
+++ src/sys/arch/arm/iomd/vidc20.c Mon May 14 10:38:08 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: vidc20.c,v 1.16 2011/07/01 20:26:35 dyoung Exp $ */
+/* $NetBSD: vidc20.c,v 1.17 2012/05/14 10:38:08 skrll Exp $ */
/*
* Copyright (c) 1997 Mark Brinicombe
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vidc20.c,v 1.16 2011/07/01 20:26:35 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vidc20.c,v 1.17 2012/05/14 10:38:08 skrll Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -59,14 +59,13 @@ __KERNEL_RCSID(0, "$NetBSD: vidc20.c,v 1
#include "locators.h"
struct vidc20_softc {
- struct device sc_dev;
+ device_t sc_dev;
bus_space_tag_t sc_iot;
};
-static int vidcmatch(struct device *, struct cfdata *, void *);
-static void vidcattach(struct device *, struct device *, void *);
-static int vidcsearch(struct device *, struct cfdata *,
- const int *, void *);
+static int vidcmatch(device_t , cfdata_t , void *);
+static void vidcattach(device_t , device_t , void *);
+static int vidcsearch(device_t , cfdata_t , const int *, void *);
/*
* vidc_base gives the base of the VIDC chip in memory; this is for
@@ -84,7 +83,7 @@ int *vidc_base = (int *)VIDC_BASE;
int vidc_fref = 24000000;
-CFATTACH_DECL(vidc, sizeof (struct vidc20_softc),
+CFATTACH_DECL_NEW(vidc, sizeof (struct vidc20_softc),
vidcmatch, vidcattach, NULL, NULL);
/*
@@ -94,7 +93,7 @@ CFATTACH_DECL(vidc, sizeof (struct vidc2
* We must assume things are ok.
*/
static int
-vidcmatch(struct device *parent, struct cfdata *cf, void *aux)
+vidcmatch(device_t parent, cfdata_t cf, void *aux)
{
return 1;
@@ -107,8 +106,7 @@ vidcmatch(struct device *parent, struct
*/
static int
-vidcsearch(struct device *parent, struct cfdata *cf,
- const int *ldesc, void *aux)
+vidcsearch(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
if (config_match(parent, cf, NULL) > 0)
@@ -123,11 +121,12 @@ vidcsearch(struct device *parent, struct
* Configure all the child devices of the VIDC
*/
static void
-vidcattach(struct device *parent, struct device *self, void *aux)
+vidcattach(device_t parent, device_t self, void *aux)
{
- struct vidc20_softc *sc = (struct vidc20_softc *)self;
+ struct vidc20_softc *sc = device_private(self);
struct mainbus_attach_args *mb = aux;
+ sc->sc_dev = self;
sc->sc_iot = mb->mb_iot;
/*
@@ -136,16 +135,16 @@ vidcattach(struct device *parent, struct
*/
switch (IOMD_ID) {
case ARM7500_IOC_ID:
- printf(": ARM7500 video and sound macrocell\n");
+ aprint_normal(": ARM7500 video and sound macrocell\n");
vidc_fref = 32000000;
break;
case ARM7500FE_IOC_ID:
- printf(": ARM7500FE video and sound macrocell\n");
+ aprint_normal(": ARM7500FE video and sound macrocell\n");
vidc_fref = 32000000;
break;
default: /* XXX default? */
case RPC600_IOMD_ID:
- printf(": VIDC20\n");
+ aprint_normal(": VIDC20\n");
vidc_fref = 24000000;
break;
}
Index: src/sys/arch/arm/iomd/vidcaudio.c
diff -u src/sys/arch/arm/iomd/vidcaudio.c:1.49 src/sys/arch/arm/iomd/vidcaudio.c:1.50
--- src/sys/arch/arm/iomd/vidcaudio.c:1.49 Thu May 10 07:39:48 2012
+++ src/sys/arch/arm/iomd/vidcaudio.c Mon May 14 10:38:08 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: vidcaudio.c,v 1.49 2012/05/10 07:39:48 skrll Exp $ */
+/* $NetBSD: vidcaudio.c,v 1.50 2012/05/14 10:38:08 skrll Exp $ */
/*
* Copyright (c) 1995 Melvin Tang-Richardson
@@ -65,7 +65,7 @@
#include <sys/param.h> /* proc.h */
-__KERNEL_RCSID(0, "$NetBSD: vidcaudio.c,v 1.49 2012/05/10 07:39:48 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vidcaudio.c,v 1.50 2012/05/14 10:38:08 skrll Exp $");
#include <sys/audioio.h>
#include <sys/conf.h> /* autoconfig functions */
@@ -106,7 +106,7 @@ extern int *vidc_base;
#endif
struct vidcaudio_softc {
- struct device sc_dev;
+ device_t sc_dev;
irqhandler_t sc_ih;
int sc_dma_intr;
@@ -125,8 +125,8 @@ struct vidcaudio_softc {
kmutex_t sc_intr_lock;
};
-static int vidcaudio_probe(struct device *, struct cfdata *, void *);
-static void vidcaudio_attach(struct device *, struct device *, void *);
+static int vidcaudio_probe(device_t , cfdata_t , void *);
+static void vidcaudio_attach(device_t , device_t , void *);
static void vidcaudio_close(void *);
static int vidcaudio_intr(void *);
@@ -140,7 +140,7 @@ static int mulaw_to_vidc_fetch_to(struct
static int mulaw_to_vidc_stereo_fetch_to(struct audio_softc *, stream_fetcher_t *,
audio_stream_t *, int);
-CFATTACH_DECL(vidcaudio, sizeof(struct vidcaudio_softc),
+CFATTACH_DECL_NEW(vidcaudio, sizeof(struct vidcaudio_softc),
vidcaudio_probe, vidcaudio_attach, NULL, NULL);
static int vidcaudio_query_encoding(void *, struct audio_encoding *);
@@ -198,7 +198,7 @@ static const struct audio_hw_if vidcaudi
};
static int
-vidcaudio_probe(struct device *parent, struct cfdata *cf, void *aux)
+vidcaudio_probe(device_t parent, cfdata_t cf, void *aux)
{
int id;
@@ -218,12 +218,12 @@ vidcaudio_probe(struct device *parent, s
static void
-vidcaudio_attach(struct device *parent, struct device *self, void *aux)
+vidcaudio_attach(device_t parent, device_t self, void *aux)
{
- struct vidcaudio_softc *sc;
- struct device *beepdev;
+ struct vidcaudio_softc *sc = device_private(self);
+ device_t beepdev;
- sc = (void *)self;
+ sc->sc_dev = self;
switch (IOMD_ID) {
#ifndef EB7500ATX
case RPC600_IOMD_ID:
Index: src/sys/arch/arm/iomd/vidcvideo.c
diff -u src/sys/arch/arm/iomd/vidcvideo.c:1.42 src/sys/arch/arm/iomd/vidcvideo.c:1.43
--- src/sys/arch/arm/iomd/vidcvideo.c:1.42 Thu May 10 09:56:27 2012
+++ src/sys/arch/arm/iomd/vidcvideo.c Mon May 14 10:38:08 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: vidcvideo.c,v 1.42 2012/05/10 09:56:27 skrll Exp $ */
+/* $NetBSD: vidcvideo.c,v 1.43 2012/05/14 10:38:08 skrll Exp $ */
/*
* Copyright (c) 2001 Reinoud Zandijk
@@ -30,7 +30,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: vidcvideo.c,v 1.42 2012/05/10 09:56:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vidcvideo.c,v 1.43 2012/05/14 10:38:08 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -119,18 +119,18 @@ struct fb_devconfig {
struct vidcvideo_softc {
- struct device sc_dev;
+ device_t sc_dev;
struct fb_devconfig *sc_dc; /* device configuration */
};
/* Function prototypes for glue */
-static int vidcvideo_match(struct device *, struct cfdata *, void *);
-static void vidcvideo_attach(struct device *, struct device *, void *);
+static int vidcvideo_match(device_t , cfdata_t , void *);
+static void vidcvideo_attach(device_t , device_t , void *);
/* config glue */
-CFATTACH_DECL(vidcvideo, sizeof(struct vidcvideo_softc),
+CFATTACH_DECL_NEW(vidcvideo, sizeof(struct vidcvideo_softc),
vidcvideo_match, vidcvideo_attach, NULL, NULL);
static struct fb_devconfig vidcvideo_console_dc;
@@ -194,7 +194,7 @@ static void vv_putchar(void *c, int row,
static int
-vidcvideo_match(struct device *parent, struct cfdata *match, void *aux)
+vidcvideo_match(device_t parent, cfdata_t match, void *aux)
{
/* Can't probe AFAIK ; how ? */
@@ -306,12 +306,14 @@ vidcvideoinit_screen(void *cookie, struc
}
static void
-vidcvideo_attach(struct device *parent, struct device *self, void *aux)
+vidcvideo_attach(device_t parent, device_t self, void *aux)
{
- struct vidcvideo_softc *sc = (struct vidcvideo_softc *)self;
+ struct vidcvideo_softc *sc = device_private(self);
struct fb_devconfig *dc;
struct wsemuldisplaydev_attach_args waa;
long defattr;
+
+ sc->sc_dev = self;
dc = sc->sc_dc = &vidcvideo_console_dc;
@@ -334,7 +336,7 @@ vidcvideo_attach(struct device *parent,
dc->dc_console.scr_flags |= VCONS_SCREEN_IS_STATIC;
vidcvideo_printdetails();
- printf(": mode %s, %dbpp\n", dc->mode_info.timings.name,
+ aprint_normal(": mode %s, %dbpp\n", dc->mode_info.timings.name,
dc->dc_depth);
/* set up interrupt flags */