Commit df42cb49 authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarTakashi Iwai <tiwai@suse.de>
parent e2acecf2
...@@ -1168,6 +1168,7 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd) ...@@ -1168,6 +1168,7 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
intelhaddata = snd_pcm_substream_chip(substream); intelhaddata = snd_pcm_substream_chip(substream);
spin_lock(&intelhaddata->had_spinlock);
switch (cmd) { switch (cmd) {
case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
...@@ -1180,8 +1181,6 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd) ...@@ -1180,8 +1181,6 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
break; break;
} }
intelhaddata->stream_info.running = true;
/* Enable Audio */ /* Enable Audio */
had_ack_irqs(intelhaddata); /* FIXME: do we need this? */ had_ack_irqs(intelhaddata); /* FIXME: do we need this? */
had_enable_audio(intelhaddata, true); had_enable_audio(intelhaddata, true);
...@@ -1189,13 +1188,6 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd) ...@@ -1189,13 +1188,6 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
case SNDRV_PCM_TRIGGER_SUSPEND:
spin_lock(&intelhaddata->had_spinlock);
/* Stop reporting BUFFER_DONE/UNDERRUN to above layers */
intelhaddata->stream_info.running = false;
spin_unlock(&intelhaddata->had_spinlock);
/* Disable Audio */ /* Disable Audio */
had_enable_audio(intelhaddata, false); had_enable_audio(intelhaddata, false);
intelhaddata->need_reset = true; intelhaddata->need_reset = true;
...@@ -1204,6 +1196,7 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd) ...@@ -1204,6 +1196,7 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
default: default:
retval = -EINVAL; retval = -EINVAL;
} }
spin_unlock(&intelhaddata->had_spinlock);
return retval; return retval;
} }
......
...@@ -83,7 +83,6 @@ struct channel_map_table { ...@@ -83,7 +83,6 @@ struct channel_map_table {
struct pcm_stream_info { struct pcm_stream_info {
struct snd_pcm_substream *substream; struct snd_pcm_substream *substream;
int substream_refcount; int substream_refcount;
bool running;
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment