Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2022138 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

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: default avatarLiam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 646e1dd8
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1124,9 +1124,6 @@ static int snd_pcm_dev_disconnect(struct snd_device *device)
	int cidx;

	mutex_lock(&register_mutex);
	if (list_empty(&pcm->list))
		goto unlock;

	mutex_lock(&pcm->open_mutex);
	wake_up(&pcm->open_wait);
	list_del_init(&pcm->list);
@@ -1146,6 +1143,7 @@ static int snd_pcm_dev_disconnect(struct snd_device *device)
			notify->n_disconnect(pcm);
	}
	for (cidx = 0; cidx < 2; cidx++) {
		if (!pcm->internal)
			snd_unregister_device(&pcm->streams[cidx].dev);
		if (pcm->streams[cidx].chmap_kctl) {
			snd_ctl_remove(pcm->card, pcm->streams[cidx].chmap_kctl);
@@ -1153,7 +1151,6 @@ static int snd_pcm_dev_disconnect(struct snd_device *device)
		}
	}
	mutex_unlock(&pcm->open_mutex);
 unlock:
	mutex_unlock(&register_mutex);
	return 0;
}