ASoC don't clobber platform DMA driver ops
PATCH 1/1 ASoC don't clobber platform DMA driver ops
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.
--- sound/soc/soc-core.c | 1 + sound/soc/soc-pcm.c | 48 ++++++++++++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 20 deletions(-)
sound/soc/soc-core.c +1 -0
@@ -1547,6 +1547,7 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card)snd_soc_dapm_free (&card->dapm); +kfree (card->rtd->ops);kfree (card->rtd);snd_card_free (card->snd_card);return 0 ;
sound/soc/soc-pcm.c +28 -20
88 lines not on this page · raw message
Signature · 1 line
1.6.0.4
A message that is not in the archive (sent off-list or not yet received): 9E5C29D1DC97674D8FB0F7D26508F7861F05DB@039-SN1MPN1-005.039d.mgd.msft.net
Quoted 1 line · On Tue, Nov 01, 2011 at 06:46:52PM +0000, Tull Alan-R80115 wrote:
This patch creates and populates a ops struct for each call to
soc_pcm_new.
This isn't very idiomatic - a much more idiomatic solution would be to add new indirection functions which do the lookups. While it's probably not going to make much difference for most things there's operations like ioctl() which definitely don't look at all DMA specific in there.
A message that is not in the archive (sent off-list or not yet received): 9E5C29D1DC97674D8FB0F7D26508F7861F0620@039-SN1MPN1-005.039d.mgd.msft.net
On Tue, Nov 01, 2011 at 06:57:47PM +0000, Tull Alan-R80115 wrote:
On public Linux lists you should never top post (so people have context and know what you're talking about) and you should fix your mail client to word wrap within paragraphs.
Quoted 4 lines
I originally started down the path you are describing, but quickly ran into problems. I started by adding a
soc_pcm_copyandsoc_pcm_mmapand found that I needed to pull code from ALSA core in to handle the case where copy or mmap was NULL for a given platform driver.
In that case your changelog needs to explain this and I'd still use a function for those ops that don't have stubs in the core. Things like ioctl() could usefully be routed to all the drivers, for example.