Page MenuHomeFreeBSD

D11140.id.diff
No OneTemporary

D11140.id.diff

Index: sys/dev/sound/pcm/mixer.c
===================================================================
--- sys/dev/sound/pcm/mixer.c
+++ sys/dev/sound/pcm/mixer.c
@@ -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;
Index: sys/dev/sound/pcm/sound.c
===================================================================
--- sys/dev/sound/pcm/sound.c
+++ sys/dev/sound/pcm/sound.c
@@ -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);
Index: sys/dev/sound/usb/uaudio.c
===================================================================
--- sys/dev/sound/usb/uaudio.c
+++ sys/dev/sound/usb/uaudio.c
@@ -1235,8 +1235,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) {

File Metadata

Mime Type
text/plain
Expires
Fri, Jul 3, 7:21 PM (6 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34614375
Default Alt Text
D11140.id.diff (1 KB)

Event Timeline