summaryrefslogtreecommitdiff
path: root/sys/dev/radio.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-05-30 15:22:27 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-05-30 15:22:27 +0000
commit96b43403d63cb7d4e6a2682a5d998e3924809548 (patch)
tree63cc2cb0d2282c3a18f0dac22214f04e572d60a5 /sys/dev/radio.c
parentaea373a0648354fae8b4626c674eb025bde7b661 (diff)
make radio attach, not steal other audio attachments
Diffstat (limited to 'sys/dev/radio.c')
-rw-r--r--sys/dev/radio.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/dev/radio.c b/sys/dev/radio.c
index 54c5f8c9f0c..bbea6d5bce7 100644
--- a/sys/dev/radio.c
+++ b/sys/dev/radio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radio.c,v 1.5 2002/01/10 18:38:24 mickey Exp $ */
+/* $OpenBSD: radio.c,v 1.6 2002/05/30 15:22:26 mickey Exp $ */
/* $RuOBSD: radio.c,v 1.7 2001/12/04 06:03:05 tm Exp $ */
/*
@@ -39,6 +39,7 @@
#include <sys/radioio.h>
#include <sys/conf.h>
+#include <dev/audio_if.h>
#include <dev/radio_if.h>
#include <dev/radiovar.h>
@@ -60,20 +61,19 @@ struct cfdriver radio_cd = {
int
radioprobe(struct device *parent, void *match, void *aux)
{
- return (1);
+ struct audio_attach_args *sa = aux;
+ return (sa->type == AUDIODEV_TYPE_RADIO) ? 1 : 0;
}
void
radioattach(struct device *parent, struct device *self, void *aux)
{
struct radio_softc *sc = (void *) self;
- struct radio_attach_args *sa = aux;
- struct radio_hw_if *hwp = sa->hwif;
- void *hdlp = sa->hdl;
+ struct audio_attach_args *sa = aux;
printf("\n");
- sc->hw_if = hwp;
- sc->hw_hdl = hdlp;
+ sc->hw_if = sa->hwif;
+ sc->hw_hdl = sa->hdl;
sc->sc_dev = parent;
}
@@ -155,8 +155,9 @@ radioioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
struct device *
radio_attach_mi(struct radio_hw_if *rhwp, void *hdlp, struct device *dev)
{
- struct radio_attach_args arg;
+ struct audio_attach_args arg;
+ arg.type = AUDIODEV_TYPE_RADIO;
arg.hwif = rhwp;
arg.hdl = hdlp;
return (config_found(dev, &arg, radioprint));