ALSA: AACI: use snd_pcm_lib_period_bytes()
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 13 Jan 2011 00:34:08 +0000 (00:34 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 26 Jan 2011 20:24:11 +0000 (20:24 +0000)
Use the helper rather than open-coding this.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
sound/arm/aaci.c
sound/arm/aaci.h

index 1e6d5f6..a8f9538 100644 (file)
@@ -541,11 +541,11 @@ static int aaci_pcm_prepare(struct snd_pcm_substream *substream)
        struct snd_pcm_runtime *runtime = substream->runtime;
        struct aaci_runtime *aacirun = runtime->private_data;
 
+       aacirun->period = snd_pcm_lib_period_bytes(substream);
        aacirun->start  = runtime->dma_area;
        aacirun->end    = aacirun->start + snd_pcm_lib_buffer_bytes(substream);
        aacirun->ptr    = aacirun->start;
-       aacirun->period =
-       aacirun->bytes  = frames_to_bytes(runtime, runtime->period_size);
+       aacirun->bytes  = aacirun->period;
 
        return 0;
 }
index 04c4568..198750d 100644 (file)
@@ -210,6 +210,8 @@ struct aaci_runtime {
        u32                     cr;
        struct snd_pcm_substream        *substream;
 
+       unsigned int            period; /* byte size of a "period" */
+
        /*
         * PIO support
         */
@@ -217,7 +219,6 @@ struct aaci_runtime {
        void                    *end;
        void                    *ptr;
        int                     bytes;
-       unsigned int            period;
        unsigned int            fifosz;
 };