From 7a3ca8147f1c32ef48a4be91b47a6d43159ae786 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 30 Aug 2022 13:18:32 +0200 Subject: [PATCH] Revert "ALSA: control: Use deferred fasync helper" This reverts commit 857ccedcf569665809d351241d22247c6c55887f 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 Change-Id: I2763e9b54b1bd192d05abecb14c54bc4df46ea56 --- include/sound/control.h | 2 +- sound/core/control.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/sound/control.h b/include/sound/control.h index 41bd72ffd232..77d9fa10812d 100644 --- a/include/sound/control.h +++ b/include/sound/control.h @@ -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 */ }; diff --git a/sound/core/control.c b/sound/core/control.c index 732eb515d2f5..3b44378b9dec 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -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);