[alsa-devel] [PATCH] ASoC don't clobber platform DMA driver ops
r80115
alan.tull at freescale.com
Tue Nov 15 18:22:50 CET 2011
On 11/15/2011 10:56 AM, Tabi Timur-B04825 wrote:
> Something is wrong. When I apply this patch, I get this:
>
> CC sound/soc/soc-core.o
> /home/b04825/git/linux.34/sound/soc/soc-core.c: In function
> 'soc_cleanup_card_resources':
> /home/b04825/git/linux.34/sound/soc/soc-core.c:1583:3: error:
> incompatible type for argument 1 of 'kfree'
> /home/b04825/git/linux.34/include/linux/slab.h:161:6: note: expected
> 'const void *' but argument is of type 'struct snd_pcm_ops'
>
> /* free the ops */
> for (i = 0; i< card->num_rtd; i++) {
> struct snd_soc_pcm_runtime *rtd =&card->rtd[i];
> kfree(rtd->ops);
> }
>
> rtd->ops is not a pointer, so it can't be freed. Also, this:
>
> + rtd->ops = soc_pcm_ops;
>
> is a memcpy. Why not just write to rtd->ops directly?
>
I see the problem. I implemented this under 2.6.38. rtd->ops was a
pointer under 2.6.38. This could change much then.
--
Regards,
Alan
More information about the Alsa-devel
mailing list