On Tue, Nov 15, 2011 at 9:59 AM, Alan Tull alan.tull@freescale.com wrote:
Previously, only one static struct for ops existed for all platform DMA drivers to share. Half of the ops are shared functions and the other half are initialized to point directly to ops in the platform driver. This creates problems where each time soc_new_pcm is called, the new platform driver's ops would overwrite a subset of the ops.
This patch creates and populates a ops struct for each call to soc_pcm_new.
Signed-off-by: Alan Tull alan.tull@freescale.com
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?