Revert "ALSA: control: Use deferred fasync helper"

This reverts commit 857ccedcf5 which is
commit 4a971e84a7ae10a38d875cd2d4e487c8d1682ca3 upstream.

It breaks the Android GKI kernel abi, and is not needed for Android
devices, so revert it for now.  If it is needed for this branch, it can
come back later in an ABI-stable way.

Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2763e9b54b1bd192d05abecb14c54bc4df46ea56
This commit is contained in:
Greg Kroah-Hartman 2022-08-30 13:18:32 +02:00
parent 5597d5439f
commit 7a3ca8147f
2 changed files with 4 additions and 5 deletions

View File

@ -103,7 +103,7 @@ struct snd_ctl_file {
int preferred_subdevice[SND_CTL_SUBDEV_ITEMS];
wait_queue_head_t change_sleep;
spinlock_t read_lock;
struct snd_fasync *fasync;
struct fasync_struct *fasync;
int subscribed; /* read interface is activated */
struct list_head events; /* waiting events for read */
};

View File

@ -121,7 +121,6 @@ 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);
@ -176,7 +175,7 @@ void snd_ctl_notify(struct snd_card *card, unsigned int mask,
_found:
wake_up(&ctl->change_sleep);
spin_unlock(&ctl->read_lock);
snd_kill_fasync(ctl->fasync, SIGIO, POLL_IN);
kill_fasync(&ctl->fasync, SIGIO, POLL_IN);
}
read_unlock_irqrestore(&card->ctl_files_rwlock, flags);
}
@ -1942,7 +1941,7 @@ static int snd_ctl_fasync(int fd, struct file * file, int on)
struct snd_ctl_file *ctl;
ctl = file->private_data;
return snd_fasync_helper(fd, file, on, &ctl->fasync);
return fasync_helper(fd, file, on, &ctl->fasync);
}
/* return the preferred subdevice number if already assigned;
@ -2016,7 +2015,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);
snd_kill_fasync(ctl->fasync, SIGIO, POLL_ERR);
kill_fasync(&ctl->fasync, SIGIO, POLL_ERR);
}
read_unlock_irqrestore(&card->ctl_files_rwlock, flags);