Skip to content

Commit 646e1dd

Browse files
committed
ALSA: pcm: Don't notify internal PCMs
Notifier shouldn't listen to the changes of internal PCMs. Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent b95bd3a commit 646e1dd

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

sound/core/pcm.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -888,8 +888,9 @@ static int snd_pcm_free(struct snd_pcm *pcm)
888888

889889
if (!pcm)
890890
return 0;
891-
list_for_each_entry(notify, &snd_pcm_notify_list, list) {
892-
notify->n_unregister(pcm);
891+
if (!pcm->internal) {
892+
list_for_each_entry(notify, &snd_pcm_notify_list, list)
893+
notify->n_unregister(pcm);
893894
}
894895
if (pcm->private_free)
895896
pcm->private_free(pcm);
@@ -1129,7 +1130,7 @@ static int snd_pcm_dev_disconnect(struct snd_device *device)
11291130
mutex_lock(&pcm->open_mutex);
11301131
wake_up(&pcm->open_wait);
11311132
list_del_init(&pcm->list);
1132-
for (cidx = 0; cidx < 2; cidx++)
1133+
for (cidx = 0; cidx < 2; cidx++) {
11331134
for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) {
11341135
snd_pcm_stream_lock_irq(substream);
11351136
if (substream->runtime) {
@@ -1139,8 +1140,10 @@ static int snd_pcm_dev_disconnect(struct snd_device *device)
11391140
}
11401141
snd_pcm_stream_unlock_irq(substream);
11411142
}
1142-
list_for_each_entry(notify, &snd_pcm_notify_list, list) {
1143-
notify->n_disconnect(pcm);
1143+
}
1144+
if (!pcm->internal) {
1145+
list_for_each_entry(notify, &snd_pcm_notify_list, list)
1146+
notify->n_disconnect(pcm);
11441147
}
11451148
for (cidx = 0; cidx < 2; cidx++) {
11461149
snd_unregister_device(&pcm->streams[cidx].dev);

0 commit comments

Comments
 (0)