From 88cdca9c7376f2220171d09dfc2f9e41b4834435 Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 23 Nov 2009 09:44:10 +0100 Subject: ALSA: AACI cleanup Fix the buffer size calculation to use the size which ALSA is expecting. Signed-off-by: Russell King Signed-off-by: Takashi Iwai --- sound/arm/aaci.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sound/arm/aaci.c') diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index 1f0f8213e2d5..a03fe80a7a73 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -18,10 +18,7 @@ #include #include #include - -#include -#include -#include +#include #include #include @@ -534,7 +531,7 @@ static int aaci_pcm_prepare(struct snd_pcm_substream *substream) struct aaci_runtime *aacirun = runtime->private_data; aacirun->start = (void *)runtime->dma_area; - aacirun->end = aacirun->start + runtime->dma_bytes; + 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); -- cgit v1.2.3 From cf5bd652c384cf58544f43bea097bbc9cf14e4f5 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 1 Dec 2009 16:36:56 +0100 Subject: ALSA: aaci - Clean up duplicate code Now snd_ac97_pcm_open() is called with the exactly same arguments for both playback and capture directions. Remove the unneeded check. Signed-off-by: Takashi Iwai --- sound/arm/aaci.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'sound/arm/aaci.c') diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index eb715e732106..83b0328d389e 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -511,15 +511,9 @@ static int aaci_pcm_hw_params(struct snd_pcm_substream *substream, if (err < 0) goto out; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) - err = snd_ac97_pcm_open(aacirun->pcm, params_rate(params), - params_channels(params), - aacirun->pcm->r[0].slots); - else - err = snd_ac97_pcm_open(aacirun->pcm, params_rate(params), - params_channels(params), - aacirun->pcm->r[0].slots); - + err = snd_ac97_pcm_open(aacirun->pcm, params_rate(params), + params_channels(params), + aacirun->pcm->r[0].slots); if (err) goto out; -- cgit v1.2.3