{
        struct snd_ali *codec = snd_pcm_substream_chip(substream);
        struct snd_pcm_substream *s;
-       unsigned int what, whati, capture_flag;
+       unsigned int what, whati;
        struct snd_ali_voice *pvoice, *evoice;
        unsigned int val;
        int do_start;
                return -EINVAL;
        }
 
-       what = whati = capture_flag = 0;
+       what = whati = 0;
        snd_pcm_group_for_each_entry(s, substream) {
                if ((struct snd_ali *) snd_pcm_substream_chip(s) == codec) {
                        pvoice = s->runtime->private_data;
                                        evoice->running = 0;
                        }
                        snd_pcm_trigger_done(s, substream);
-                       if (pvoice->mode)
-                               capture_flag = 1;
                }
        }
        spin_lock(&codec->reg_lock);