No need to track every closing instance, and put busy counter to rest

in its single bit coffin.
This commit is contained in:
Ariff Abdullah 2007-04-02 03:46:25 +00:00
parent 15735bec61
commit 3627e77dfa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=168247

View File

@ -37,7 +37,7 @@ struct snd_mixer {
KOBJ_FIELDS;
const char *type;
void *devinfo;
int busy;
int busy:1;
int hwvol_muted;
int hwvol_mixer;
int hwvol_step;
@ -86,7 +86,7 @@ static d_close_t mixer_close;
static struct cdevsw mixer_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_TRACKCLOSE | D_NEEDGIANT,
.d_flags = D_NEEDGIANT,
.d_open = mixer_open,
.d_close = mixer_close,
.d_ioctl = mixer_ioctl,
@ -733,7 +733,7 @@ mixer_open(struct cdev *i_dev, int flags, int mode, struct thread *td)
m = i_dev->si_drv1;
snd_mtxlock(m->lock);
m->busy++;
m->busy = 1;
snd_mtxunlock(m->lock);
return 0;
@ -751,7 +751,7 @@ mixer_close(struct cdev *i_dev, int flags, int mode, struct thread *td)
snd_mtxunlock(m->lock);
return EBADF;
}
m->busy--;
m->busy = 0;
snd_mtxunlock(m->lock);
return 0;