[alsa-devel] [PATCH] ASoC: core - Fix dai usage in pcm_new() platform handlers

Mark Brown broonie at opensource.wolfsonmicro.com
Wed Jun 22 20:10:23 CEST 2011


On Wed, Jun 22, 2011 at 08:05:29PM +0200, Daniel Mack wrote:
> Commit 552d1ef ("ASoC: core - Optimise and refactor pcm_new() to pass
> only rtd") refactored the ASoC internal core to only pass a pointer
> to a runtime as argument to individual pcm_new() functions. However, the
> new code that was added to the handlers to get access to the dai now
> uses rtd->cpu_dai, while before this patch, rtd->codec_dai was used.

Which is a problem because...

> diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c
> index f81d4c3..d1140c1 100644
> --- a/sound/soc/atmel/atmel-pcm.c
> +++ b/sound/soc/atmel/atmel-pcm.c
> @@ -367,7 +367,7 @@ static u64 atmel_pcm_dmamask = 0xffffffff;
>  static int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd)
>  {
>  	struct snd_card *card = rtd->card->snd_card;
> -	struct snd_soc_dai *dai = rtd->cpu_dai;
> +	struct snd_soc_dai *dai = rtd->codec_dai;
>  	struct snd_pcm *pcm = rtd->pcm;
>  	int ret = 0;
>  

The original code doesn't look obviously wrong while if the CPU driver
is peering at the CODEC driver that smells very bad.  What's the actual
problem here?


More information about the Alsa-devel mailing list