diff options
-rw-r--r-- | sound/core/pcm.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c index d440629e08e2..542dbc6f54e8 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c | |||
@@ -888,8 +888,9 @@ static int snd_pcm_free(struct snd_pcm *pcm) | |||
888 | 888 | ||
889 | if (!pcm) | 889 | if (!pcm) |
890 | return 0; | 890 | return 0; |
891 | list_for_each_entry(notify, &snd_pcm_notify_list, list) { | 891 | if (!pcm->internal) { |
892 | notify->n_unregister(pcm); | 892 | list_for_each_entry(notify, &snd_pcm_notify_list, list) |
893 | notify->n_unregister(pcm); | ||
893 | } | 894 | } |
894 | if (pcm->private_free) | 895 | if (pcm->private_free) |
895 | pcm->private_free(pcm); | 896 | pcm->private_free(pcm); |
@@ -1129,7 +1130,7 @@ static int snd_pcm_dev_disconnect(struct snd_device *device) | |||
1129 | mutex_lock(&pcm->open_mutex); | 1130 | mutex_lock(&pcm->open_mutex); |
1130 | wake_up(&pcm->open_wait); | 1131 | wake_up(&pcm->open_wait); |
1131 | list_del_init(&pcm->list); | 1132 | list_del_init(&pcm->list); |
1132 | for (cidx = 0; cidx < 2; cidx++) | 1133 | for (cidx = 0; cidx < 2; cidx++) { |
1133 | for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) { | 1134 | for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) { |
1134 | snd_pcm_stream_lock_irq(substream); | 1135 | snd_pcm_stream_lock_irq(substream); |
1135 | if (substream->runtime) { | 1136 | if (substream->runtime) { |
@@ -1139,8 +1140,10 @@ static int snd_pcm_dev_disconnect(struct snd_device *device) | |||
1139 | } | 1140 | } |
1140 | snd_pcm_stream_unlock_irq(substream); | 1141 | snd_pcm_stream_unlock_irq(substream); |
1141 | } | 1142 | } |
1142 | list_for_each_entry(notify, &snd_pcm_notify_list, list) { | 1143 | } |
1143 | notify->n_disconnect(pcm); | 1144 | if (!pcm->internal) { |
1145 | list_for_each_entry(notify, &snd_pcm_notify_list, list) | ||
1146 | notify->n_disconnect(pcm); | ||
1144 | } | 1147 | } |
1145 | for (cidx = 0; cidx < 2; cidx++) { | 1148 | for (cidx = 0; cidx < 2; cidx++) { |
1146 | snd_unregister_device(&pcm->streams[cidx].dev); | 1149 | snd_unregister_device(&pcm->streams[cidx].dev); |