[alsa-devel] [PATCH] ALSA: ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream

Daniel Mack daniel at caiaq.de
Thu Mar 18 19:28:13 CET 2010


On Thu, Mar 18, 2010 at 06:22:11PM +0000, Mark Brown wrote:
> On Thu, Mar 18, 2010 at 07:08:59PM +0100, Daniel Mack wrote:
> > This fixes a memory corruption when using ASoC devices are used in
> > full-duplex mode. Specifically for pxa-ssp code, where this pointer
> > is dynamically allocated for each direction and destroyed upon each
> > stream start.
> 
> > All other platforms are fixed blindly, I couldn't even compile-test
> > them. Sorry for any breakage I may have caused.
> 
> Looks good at first pass, though I think there's some more platforms
> have been missed?  I'm just about to leave for today, Liam and I will
> check properly tomorrow.  Thanks for diagnosing this!

This is all 'git grep' brought up. Other places should be easy to fix
though in case I missed any. Thanks for double-checking.


> > +static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai,
> > +					     const struct snd_pcm_substream *ss)
> > +{
> > +	return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
> > +		dai->playback.dma_data : dai->capture.dma_data;
> > +}
> > +
> > +static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai,
> > +					    const struct snd_pcm_substream *ss,
> > +					    void *data)
> > +{
> > +	if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
> > +		dai->playback.dma_data = data;
> > +	else
> > +		dai->capture.dma_data = data;
> > +}
> 
> Make your mind up if you like the ternery operator :P

Well - I do, and I use it whereever I can. But in the 'set' case, I can't.
Or did I miss the joke? ;)



More information about the Alsa-devel mailing list