[alsa-devel] [PATCH] ASoC: Allocate PCM operations dynamically to support multiple DAIs

Mark Brown broonie at opensource.wolfsonmicro.com
Fri Dec 23 11:24:14 CET 2011


On Fri, Dec 23, 2011 at 10:37:51AM +0900, Sangbeom Kim wrote:

> +	soc_pcm_ops = kzalloc(sizeof(*soc_pcm_ops), GFP_KERNEL);
> +	if (soc_pcm_ops == NULL) {
> +		snd_printk(KERN_ERR "Cannot allocate PCM OPS\n");
> +		return -ENOMEM;
> +	}

This patch is good and fixes a real problem but can you please change it
slightly so that instead of dynamically allocating the soc_pcm_ops we
just embed it directly in the runtime structure.  Since every runtime
needs an ops structure we may as well just have it embedded directly and
not write the allocation, freeing and error handling code.


More information about the Alsa-devel mailing list