diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-05-30 15:22:27 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-05-30 15:22:27 +0000 |
commit | 96b43403d63cb7d4e6a2682a5d998e3924809548 (patch) | |
tree | 63cc2cb0d2282c3a18f0dac22214f04e572d60a5 /sys/dev | |
parent | aea373a0648354fae8b4626c674eb025bde7b661 (diff) |
make radio attach, not steal other audio attachments
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/radio.c | 17 | ||||
-rw-r--r-- | sys/dev/radio_if.h | 7 |
2 files changed, 10 insertions, 14 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)); diff --git a/sys/dev/radio_if.h b/sys/dev/radio_if.h index b44d4711ae8..969a6052eaf 100644 --- a/sys/dev/radio_if.h +++ b/sys/dev/radio_if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: radio_if.h,v 1.2 2001/12/05 10:27:06 mickey Exp $ */ +/* $OpenBSD: radio_if.h,v 1.3 2002/05/30 15:22:26 mickey Exp $ */ /* $RuOBSD: radio_if.h,v 1.6 2001/10/18 16:51:36 pva Exp $ */ /* @@ -47,11 +47,6 @@ struct radio_hw_if { int (*search)(void *, int); }; -struct radio_attach_args { - struct radio_hw_if *hwif; - void *hdl; -}; - struct device *radio_attach_mi(struct radio_hw_if *, void *, struct device *); #endif /* _SYS_DEV_RADIO_IF_H */ |