ALSA: control: Use deferred fasync helper
[linux-block.git] / sound / core / control.c
index 4dba3a342458f2ff43497ba5da45ad617c6345e3..f3e893715369f0c759bca83e1184cff63e075398 100644 (file)
@@ -127,6 +127,7 @@ static int snd_ctl_release(struct inode *inode, struct file *file)
                        if (control->vd[idx].owner == ctl)
                                control->vd[idx].owner = NULL;
        up_write(&card->controls_rwsem);
+       snd_fasync_free(ctl->fasync);
        snd_ctl_empty_read_queue(ctl);
        put_pid(ctl->pid);
        kfree(ctl);
@@ -181,7 +182,7 @@ void snd_ctl_notify(struct snd_card *card, unsigned int mask,
        _found:
                wake_up(&ctl->change_sleep);
                spin_unlock(&ctl->read_lock);
-               kill_fasync(&ctl->fasync, SIGIO, POLL_IN);
+               snd_kill_fasync(ctl->fasync, SIGIO, POLL_IN);
        }
        read_unlock_irqrestore(&card->ctl_files_rwlock, flags);
 }
@@ -2134,7 +2135,7 @@ static int snd_ctl_fasync(int fd, struct file * file, int on)
        struct snd_ctl_file *ctl;
 
        ctl = file->private_data;
-       return fasync_helper(fd, file, on, &ctl->fasync);
+       return snd_fasync_helper(fd, file, on, &ctl->fasync);
 }
 
 /* return the preferred subdevice number if already assigned;
@@ -2302,7 +2303,7 @@ static int snd_ctl_dev_disconnect(struct snd_device *device)
        read_lock_irqsave(&card->ctl_files_rwlock, flags);
        list_for_each_entry(ctl, &card->ctl_files, list) {
                wake_up(&ctl->change_sleep);
-               kill_fasync(&ctl->fasync, SIGIO, POLL_ERR);
+               snd_kill_fasync(ctl->fasync, SIGIO, POLL_ERR);
        }
        read_unlock_irqrestore(&card->ctl_files_rwlock, flags);