summaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-02-20 17:05:27 +0100
committerTakashi Iwai <tiwai@suse.de>2015-02-20 19:52:04 +0100
commitb20221385c40155f13068be75b865170a1ad5d1e (patch)
tree7cff75ce80cffaa16094430c33e90b0fa265e54b /sound/core
parent646e1dd8f9f47c57560ce81c02fdd57ff0929bc6 (diff)
downloadblackbird-obmc-linux-b20221385c40155f13068be75b865170a1ad5d1e.tar.gz
blackbird-obmc-linux-b20221385c40155f13068be75b865170a1ad5d1e.zip
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>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/pcm.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 542dbc6f54e8..e9b87465c73d 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -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,14 +1143,14 @@ static int snd_pcm_dev_disconnect(struct snd_device *device)
notify->n_disconnect(pcm);
}
for (cidx = 0; cidx < 2; cidx++) {
- snd_unregister_device(&pcm->streams[cidx].dev);
+ 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);
pcm->streams[cidx].chmap_kctl = NULL;
}
}
mutex_unlock(&pcm->open_mutex);
- unlock:
mutex_unlock(&register_mutex);
return 0;
}
OpenPOWER on IntegriCloud