summaryrefslogtreecommitdiffstats
path: root/sound/x86
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-02-12 05:35:44 -0500
committerTakashi Iwai <tiwai@suse.de>2017-02-13 08:51:13 -0500
commitdf42cb499eb1869bfb535f6c6b5ea1406496baf4 (patch)
tree7ceabee381b36399c57dbb60d402998e3d30acc8 /sound/x86
parente2acecf2c88370f9d7252e7a05cd7b6d43aed720 (diff)
ALSA: x86: Drop unused stream.running field
The pcm_stream_info.running field is only set in the PCM trigger callback but never referred, thus it can be safely removed. Also, properly cover the spinlock in both the trigger START and STOP to protect had_enable_audio() calls. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/x86')
-rw-r--r--sound/x86/intel_hdmi_audio.c11
-rw-r--r--sound/x86/intel_hdmi_audio.h1
2 files changed, 2 insertions, 10 deletions
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index 015d57cd9725..9889cdf3ccf4 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -1168,6 +1168,7 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
1168 1168
1169 intelhaddata = snd_pcm_substream_chip(substream); 1169 intelhaddata = snd_pcm_substream_chip(substream);
1170 1170
1171 spin_lock(&intelhaddata->had_spinlock);
1171 switch (cmd) { 1172 switch (cmd) {
1172 case SNDRV_PCM_TRIGGER_START: 1173 case SNDRV_PCM_TRIGGER_START:
1173 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 1174 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
@@ -1180,8 +1181,6 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
1180 break; 1181 break;
1181 } 1182 }
1182 1183
1183 intelhaddata->stream_info.running = true;
1184
1185 /* Enable Audio */ 1184 /* Enable Audio */
1186 had_ack_irqs(intelhaddata); /* FIXME: do we need this? */ 1185 had_ack_irqs(intelhaddata); /* FIXME: do we need this? */
1187 had_enable_audio(intelhaddata, true); 1186 had_enable_audio(intelhaddata, true);
@@ -1189,13 +1188,6 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
1189 1188
1190 case SNDRV_PCM_TRIGGER_STOP: 1189 case SNDRV_PCM_TRIGGER_STOP:
1191 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 1190 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
1192 case SNDRV_PCM_TRIGGER_SUSPEND:
1193 spin_lock(&intelhaddata->had_spinlock);
1194
1195 /* Stop reporting BUFFER_DONE/UNDERRUN to above layers */
1196
1197 intelhaddata->stream_info.running = false;
1198 spin_unlock(&intelhaddata->had_spinlock);
1199 /* Disable Audio */ 1191 /* Disable Audio */
1200 had_enable_audio(intelhaddata, false); 1192 had_enable_audio(intelhaddata, false);
1201 intelhaddata->need_reset = true; 1193 intelhaddata->need_reset = true;
@@ -1204,6 +1196,7 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
1204 default: 1196 default:
1205 retval = -EINVAL; 1197 retval = -EINVAL;
1206 } 1198 }
1199 spin_unlock(&intelhaddata->had_spinlock);
1207 return retval; 1200 return retval;
1208} 1201}
1209 1202
diff --git a/sound/x86/intel_hdmi_audio.h b/sound/x86/intel_hdmi_audio.h
index 8b9e184fef44..d6ba90fd011d 100644
--- a/sound/x86/intel_hdmi_audio.h
+++ b/sound/x86/intel_hdmi_audio.h
@@ -83,7 +83,6 @@ struct channel_map_table {
83struct pcm_stream_info { 83struct pcm_stream_info {
84 struct snd_pcm_substream *substream; 84 struct snd_pcm_substream *substream;
85 int substream_refcount; 85 int substream_refcount;
86 bool running;
87}; 86};
88 87
89/* 88/*