提交 b07a14a5 编写于 作者: T Takashi Iwai 提交者: Jaroslav Kysela

[ALSA] pcxhr - Minor optimization in trigger callback

Minor optimization in trigger start callback.  This fixes a nasty
compile warning, too.
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NJaroslav Kysela <perex@suse.cz>
上级 b942cf81
...@@ -639,19 +639,21 @@ static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd) ...@@ -639,19 +639,21 @@ static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd)
{ {
struct pcxhr_stream *stream; struct pcxhr_stream *stream;
struct snd_pcm_substream *s; struct snd_pcm_substream *s;
int i;
switch (cmd) { switch (cmd) {
case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_START:
snd_printdd("SNDRV_PCM_TRIGGER_START\n"); snd_printdd("SNDRV_PCM_TRIGGER_START\n");
i = 0; if (snd_pcm_stream_linked(subs)) {
snd_pcm_group_for_each_entry(s, subs) { struct snd_pcxhr *chip = snd_pcm_substream_chip(subs);
stream = s->runtime->private_data; snd_pcm_group_for_each_entry(s, subs) {
stream->status = PCXHR_STREAM_STATUS_SCHEDULE_RUN; stream = s->runtime->private_data;
snd_pcm_trigger_done(s, subs); stream->status =
i++; PCXHR_STREAM_STATUS_SCHEDULE_RUN;
} snd_pcm_trigger_done(s, subs);
if (i==1) { }
tasklet_hi_schedule(&chip->mgr->trigger_taskq);
} else {
stream = subs->runtime->private_data;
snd_printdd("Only one Substream %c %d\n", snd_printdd("Only one Substream %c %d\n",
stream->pipe->is_capture ? 'C' : 'P', stream->pipe->is_capture ? 'C' : 'P',
stream->pipe->first_audio); stream->pipe->first_audio);
...@@ -663,9 +665,6 @@ static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd) ...@@ -663,9 +665,6 @@ static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd)
if (pcxhr_set_stream_state(stream)) if (pcxhr_set_stream_state(stream))
return -EINVAL; return -EINVAL;
stream->status = PCXHR_STREAM_STATUS_RUNNING; stream->status = PCXHR_STREAM_STATUS_RUNNING;
} else {
struct snd_pcxhr *chip = snd_pcm_substream_chip(subs);
tasklet_hi_schedule(&chip->mgr->trigger_taskq);
} }
break; break;
case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_STOP:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册