summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>1999-12-03 08:41:24 +0000
committermdodd <mdodd@FreeBSD.org>1999-12-03 08:41:24 +0000
commit87e31f4b90cff07f3812e55d1980e47ac53a3904 (patch)
tree45f3bb4d1df765c421992403379a9575229036d0 /sys/dev/sound
parentd7c9e9ad5f8564f402794c5a8175fffea1a5376e (diff)
downloadFreeBSD-src-87e31f4b90cff07f3812e55d1980e47ac53a3904.zip
FreeBSD-src-87e31f4b90cff07f3812e55d1980e47ac53a3904.tar.gz
Remove the 'ivars' arguement to device_add_child() and
device_add_child_ordered(). 'ivars' may now be set using the device_set_ivars() function. This makes it easier for us to change how arbitrary data structures are associated with a device_t. Eventually we won't be modifying device_t to add additional pointers for ivars, softc data etc. Despite my best efforts I've probably forgotten something so let me know if this breaks anything. I've been running with this change for months and its been quite involved actually isolating all the changes from the rest of the local changes in my tree. Reviewed by: peter, dfr
Diffstat (limited to 'sys/dev/sound')
-rw-r--r--sys/dev/sound/isa/gusc.c17
-rw-r--r--sys/dev/sound/isa/sbc.c10
-rw-r--r--sys/dev/sound/pci/csa.c7
3 files changed, 24 insertions, 10 deletions
diff --git a/sys/dev/sound/isa/gusc.c b/sys/dev/sound/isa/gusc.c
index 93fa250..b6de776 100644
--- a/sys/dev/sound/isa/gusc.c
+++ b/sys/dev/sound/isa/gusc.c
@@ -112,6 +112,7 @@ static devclass_t gusc_devclass;
static int
gusc_probe(device_t dev)
{
+ device_t child;
u_int32_t vend_id, logical_id;
char *s;
struct sndcard_func *func;
@@ -133,7 +134,8 @@ gusc_probe(device_t dev)
return (ENOMEM);
bzero(func, sizeof(*func));
func->func = SCF_PCM;
- device_add_child(dev, "pcm", -1, func);
+ child = device_add_child(dev, "pcm", -1);
+ device_set_ivars(child, func);
break;
#if notyet
case LOGICALID_OPL:
@@ -143,7 +145,8 @@ gusc_probe(device_t dev)
return (ENOMEM);
bzero(func, sizeof(*func));
func->func = SCF_SYNTH;
- device_add_child(dev, "midi", -1, func);
+ child = device_add_child(dev, "midi", -1);
+ device_set_ivars(child, func);
break;
case LOGICALID_MIDI:
s = "Gravis UltraSound Plug & Play MIDI";
@@ -152,7 +155,8 @@ gusc_probe(device_t dev)
return (ENOMEM);
bzero(func, sizeof(*func));
func->func = SCF_MIDI;
- device_add_child(dev, "midi", -1, func);
+ child = device_add_child(dev, "midi", -1);
+ device_set_ivars(child, func);
break;
#endif /* notyet */
}
@@ -186,6 +190,7 @@ port_rd(struct resource *r, int i)
static int
gusisa_probe(device_t dev)
{
+ device_t child;
struct resource *res, *res2;
int base, rid, rid2, s, flags;
unsigned char val;
@@ -283,7 +288,8 @@ gusisa_probe(device_t dev)
return ENOMEM;
bzero(func, sizeof *func);
func->func = SCF_MIDI;
- device_add_child(dev, "midi", -1, func);
+ child = device_add_child(dev, "midi", -1);
+ device_set_ivars(child, func);
#endif /* notyet */
func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT);
@@ -292,7 +298,8 @@ gusisa_probe(device_t dev)
else {
bzero(func, sizeof *func);
func->func = SCF_PCM;
- device_add_child(dev, "pcm", -1, func);
+ child = device_add_child(dev, "pcm", -1);
+ device_set_ivars(child, func);
}
device_set_desc(dev, "Gravis UltraSound MAX");
return 0;
diff --git a/sys/dev/sound/isa/sbc.c b/sys/dev/sound/isa/sbc.c
index 8f3a4ee..7e9080e 100644
--- a/sys/dev/sound/isa/sbc.c
+++ b/sys/dev/sound/isa/sbc.c
@@ -86,6 +86,7 @@ static devclass_t sbc_devclass;
static int
sbc_probe(device_t dev)
{
+ device_t child;
u_int32_t vend_id, logical_id, vend_id2;
char *s;
struct sndcard_func *func;
@@ -177,7 +178,8 @@ sbc_probe(device_t dev)
return (ENOMEM);
bzero(func, sizeof(*func));
func->func = SCF_PCM;
- device_add_child(dev, "pcm", -1, func);
+ child = device_add_child(dev, "pcm", -1);
+ device_set_ivars(child, func);
#if notyet
/* Midi Interface */
@@ -186,7 +188,8 @@ sbc_probe(device_t dev)
return (ENOMEM);
bzero(func, sizeof(*func));
func->func = SCF_MIDI;
- device_add_child(dev, "midi", -1, func);
+ child = device_add_child(dev, "midi", -1);
+ device_set_ivars(child, func);
/* OPL FM Synthesizer */
func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT);
@@ -194,7 +197,8 @@ sbc_probe(device_t dev)
return (ENOMEM);
bzero(func, sizeof(*func));
func->func = SCF_SYNTH;
- device_add_child(dev, "midi", -1, func);
+ child = device_add_child(dev, "midi", -1);
+ device_set_ivars(child, func);
#endif /* notyet */
return (0);
diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c
index 1637143..eebeda6 100644
--- a/sys/dev/sound/pci/csa.c
+++ b/sys/dev/sound/pci/csa.c
@@ -91,6 +91,7 @@ static devclass_t csa_devclass;
static int
csa_probe(device_t dev)
{
+ device_t child;
char *s;
struct sndcard_func *func;
@@ -119,7 +120,8 @@ csa_probe(device_t dev)
return (ENOMEM);
bzero(func, sizeof(*func));
func->func = SCF_PCM;
- device_add_child(dev, "pcm", -1, func);
+ child = device_add_child(dev, "pcm", -1);
+ device_set_ivars(child, func);
#if notyet
/* Midi Interface */
@@ -128,7 +130,8 @@ csa_probe(device_t dev)
return (ENOMEM);
bzero(func, sizeof(*func));
func->func = SCF_MIDI;
- device_add_child(dev, "midi", -1, func);
+ child = device_add_child(dev, "midi", -1);
+ device_set_ivars(child, func);
#endif /* notyet */
return (0);
OpenPOWER on IntegriCloud