Skip to content

Commit b202213

Browse files
committed
ALSA: pcm: Don't ignore internal PCMs in snd_pcm_dev_disconnect()
Some codes in snd_pcm_dev_disconnect() are still valid even for internal PCMs, but they are skipped because of the check of list_empty(&pcm->list) at the beginning. Remove this check and put pcm->internal checks appropriately for internal PCM object to process through this function. Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 646e1dd commit b202213

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

sound/core/pcm.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,9 +1124,6 @@ static int snd_pcm_dev_disconnect(struct snd_device *device)
11241124
int cidx;
11251125

11261126
mutex_lock(&register_mutex);
1127-
if (list_empty(&pcm->list))
1128-
goto unlock;
1129-
11301127
mutex_lock(&pcm->open_mutex);
11311128
wake_up(&pcm->open_wait);
11321129
list_del_init(&pcm->list);
@@ -1146,14 +1143,14 @@ static int snd_pcm_dev_disconnect(struct snd_device *device)
11461143
notify->n_disconnect(pcm);
11471144
}
11481145
for (cidx = 0; cidx < 2; cidx++) {
1149-
snd_unregister_device(&pcm->streams[cidx].dev);
1146+
if (!pcm->internal)
1147+
snd_unregister_device(&pcm->streams[cidx].dev);
11501148
if (pcm->streams[cidx].chmap_kctl) {
11511149
snd_ctl_remove(pcm->card, pcm->streams[cidx].chmap_kctl);
11521150
pcm->streams[cidx].chmap_kctl = NULL;
11531151
}
11541152
}
11551153
mutex_unlock(&pcm->open_mutex);
1156-
unlock:
11571154
mutex_unlock(&register_mutex);
11581155
return 0;
11591156
}

0 commit comments

Comments
 (0)