summaryrefslogtreecommitdiffstats
path: root/sound/pci/pcxhr/pcxhr.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-03-28 17:19:29 +0200
committerJaroslav Kysela <perex@suse.cz>2007-05-11 16:55:54 +0200
commitb07a14a549589e23be40f6b344df9512ba462e3f (patch)
tree0571afe90144cf7b37fdb57b8f627431832e2ef3 /sound/pci/pcxhr/pcxhr.c
parentb942cf815b5775288550f99f3790e29815bb70cb (diff)
downloadlinux-b07a14a549589e23be40f6b344df9512ba462e3f.tar.bz2
[ALSA] pcxhr - Minor optimization in trigger callback
Minor optimization in trigger start callback. This fixes a nasty compile warning, too. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/pcxhr/pcxhr.c')
-rw-r--r--sound/pci/pcxhr/pcxhr.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c
index e1bdeed3a465..f7f6a687f033 100644
--- a/sound/pci/pcxhr/pcxhr.c
+++ b/sound/pci/pcxhr/pcxhr.c
@@ -639,19 +639,21 @@ static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd)
{
struct pcxhr_stream *stream;
struct snd_pcm_substream *s;
- int i;
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
snd_printdd("SNDRV_PCM_TRIGGER_START\n");
- i = 0;
- snd_pcm_group_for_each_entry(s, subs) {
- stream = s->runtime->private_data;
- stream->status = PCXHR_STREAM_STATUS_SCHEDULE_RUN;
- snd_pcm_trigger_done(s, subs);
- i++;
- }
- if (i==1) {
+ if (snd_pcm_stream_linked(subs)) {
+ struct snd_pcxhr *chip = snd_pcm_substream_chip(subs);
+ snd_pcm_group_for_each_entry(s, subs) {
+ stream = s->runtime->private_data;
+ stream->status =
+ PCXHR_STREAM_STATUS_SCHEDULE_RUN;
+ snd_pcm_trigger_done(s, subs);
+ }
+ tasklet_hi_schedule(&chip->mgr->trigger_taskq);
+ } else {
+ stream = subs->runtime->private_data;
snd_printdd("Only one Substream %c %d\n",
stream->pipe->is_capture ? 'C' : 'P',
stream->pipe->first_audio);
@@ -663,9 +665,6 @@ static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd)
if (pcxhr_set_stream_state(stream))
return -EINVAL;
stream->status = PCXHR_STREAM_STATUS_RUNNING;
- } else {
- struct snd_pcxhr *chip = snd_pcm_substream_chip(subs);
- tasklet_hi_schedule(&chip->mgr->trigger_taskq);
}
break;
case SNDRV_PCM_TRIGGER_STOP: