--- /usr/src/sys/dev/sound/pcm/mixer.c (revision 366623) +++ /usr/src/sys/dev/sound/pcm/mixer.c (working copy) @@ -774,25 +774,14 @@ d = device_get_softc(dev); pdev = mixer_get_devt(dev); - if (d == NULL || pdev == NULL || pdev->si_drv1 == NULL) + if (d == NULL || pdev == NULL || (m = pdev->si_drv1) == NULL) return EBADF; - m = pdev->si_drv1; KASSERT(m != NULL, ("NULL snd_mixer")); KASSERT(m->type == MIXER_TYPE_PRIMARY, ("%s(): illegal mixer type=%d", __func__, m->type)); - snd_mtxlock(m->lock); - - if (m->busy) { - snd_mtxunlock(m->lock); - return EBUSY; - } - - /* destroy dev can sleep --hps */ - - snd_mtxunlock(m->lock); - + d->mixer_dev = NULL; pdev->si_drv1 = NULL; destroy_dev(pdev); @@ -812,7 +801,6 @@ snd_mtxfree(m->lock); kobj_delete((kobj_t)m, M_MIXER); - d->mixer_dev = NULL; --mixer_count; --- /usr/src/sys/dev/sound/pcm/sound.c (revision 366623) +++ /usr/src/sys/dev/sound/pcm/sound.c (working copy) @@ -1145,9 +1145,7 @@ { struct snddev_info *d; struct pcm_channel *ch; - struct thread *td; - td = curthread; d = device_get_softc(dev); if (!PCM_ALIVE(d)) { @@ -1194,15 +1192,7 @@ } } - if (mixer_uninit(dev) == EBUSY) { - device_printf(dev, "unregister: mixer busy\n"); - PCM_LOCK(d); - if (d->clones != NULL) - (void)snd_clone_enable(d->clones); - PCM_RELEASE(d); - PCM_UNLOCK(d); - return (EBUSY); - } + mixer_uninit(dev); /* remove /dev/sndstat entry first */ sndstat_unregister(dev); --- /usr/src/sys/dev/sound/usb/uaudio.c (revision 366623) +++ /usr/src/sys/dev/sound/usb/uaudio.c (working copy) @@ -1230,8 +1230,10 @@ if (sc->sc_child[i].pcm_registered) { error = pcm_unregister(dev); } else { - if (sc->sc_child[i].mixer_init) - error = mixer_uninit(dev); + if (sc->sc_child[i].mixer_init) { + error = 0; + mixer_uninit(dev); + } } if (error) {