소스 검색

ALSA: AACI: use snd_pcm_lib_period_bytes()

Use the helper rather than open-coding this.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Russell King 14 년 전
부모
커밋
c0dea82c3c
2개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      sound/arm/aaci.c
  2. 2 1
      sound/arm/aaci.h

+ 2 - 2
sound/arm/aaci.c

@@ -541,11 +541,11 @@ static int aaci_pcm_prepare(struct snd_pcm_substream *substream)
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct aaci_runtime *aacirun = runtime->private_data;
 	struct aaci_runtime *aacirun = runtime->private_data;
 
 
+	aacirun->period	= snd_pcm_lib_period_bytes(substream);
 	aacirun->start	= runtime->dma_area;
 	aacirun->start	= runtime->dma_area;
 	aacirun->end	= aacirun->start + snd_pcm_lib_buffer_bytes(substream);
 	aacirun->end	= aacirun->start + snd_pcm_lib_buffer_bytes(substream);
 	aacirun->ptr	= aacirun->start;
 	aacirun->ptr	= aacirun->start;
-	aacirun->period	=
-	aacirun->bytes	= frames_to_bytes(runtime, runtime->period_size);
+	aacirun->bytes	= aacirun->period;
 
 
 	return 0;
 	return 0;
 }
 }

+ 2 - 1
sound/arm/aaci.h

@@ -210,6 +210,8 @@ struct aaci_runtime {
 	u32			cr;
 	u32			cr;
 	struct snd_pcm_substream	*substream;
 	struct snd_pcm_substream	*substream;
 
 
+	unsigned int		period;	/* byte size of a "period" */
+
 	/*
 	/*
 	 * PIO support
 	 * PIO support
 	 */
 	 */
@@ -217,7 +219,6 @@ struct aaci_runtime {
 	void			*end;
 	void			*end;
 	void			*ptr;
 	void			*ptr;
 	int			bytes;
 	int			bytes;
-	unsigned int		period;
 	unsigned int		fifosz;
 	unsigned int		fifosz;
 };
 };