4 Feb
2009
4 Feb
'09
1:58 p.m.
On Wed, 04 Feb 2009 13:52:06 +0100 Takashi Iwai tiwai@suse.de wrote:
At Wed, 4 Feb 2009 13:18:35 +0100, Hans-Christian Egtvedt wrote:
+static int at32_abdac_trigger(struct snd_pcm_substream *substream, int cmd) +{
- struct at32_abdac *dac =
snd_pcm_substream_chip(substream);
- int retval = -EINVAL;
- switch (cmd) {
- case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: /* fall through
*/
- case SNDRV_PCM_TRIGGER_RESUME: /* fall through */
- case SNDRV_PCM_TRIGGER_START:
clk_enable(dac->sample_clk);
retval = dw_dma_cyclic_start(dac->dma.chan);
if (retval)
goto out;
dac_writel(dac, CTRL, DAC_BIT(EN));
break;
- case SNDRV_PCM_TRIGGER_PAUSE_PUSH: /* fall through */
- case SNDRV_PCM_TRIGGER_SUSPEND: /* fall through */
- case SNDRV_PCM_TRIGGER_STOP:
set_bit(DMA_STOP, &dac->flags);
dw_dma_cyclic_stop(dac->dma.chan);
dac_writel(dac, DATA, 0);
dac_writel(dac, CTRL, 0);
clk_disable(dac->sample_clk);
break;
No retval is set for these cases?
Nope, they are all void return functions and will always complete successfully.
I meant that retval is kept -EINVAL in the cases for STOP, etc, although the call is successful.
Ops, my bad, will fix.
Thanks.
--
Best regards,
Hans-Christian Egtvedt