[alsa-devel] [PATCH V2 5/9] Main rewite of the mpc5200 audio DMA code

Mark Brown broonie at opensource.wolfsonmicro.com
Sun May 24 13:26:49 CEST 2009


On Sat, May 23, 2009 at 07:13:05PM -0400, Jon Smirl wrote:

This is all basically OK bearing in mind that I know nothing about the
hardware.  A couple of things, though:

> +/* ---------------------------------------------------------------------
> + * Sysfs attributes for debugging
> + */

These look like they may be better placed in debugfs?

> +EXPORT_SYMBOL_GPL(mpc5200_audio_dma_create);

> +EXPORT_SYMBOL_GPL(mpc5200_audio_dma_destroy);

> +static int __init mpc5200_soc_platform_init(void)
> +{
> +	/* Tell the ASoC OF helpers about it */
> +	return snd_soc_register_platform(&mpc5200_audio_dma_platform);
> +}
> +module_init(mpc5200_soc_platform_init);

> +static void __exit mpc5200_soc_platform_exit(void)
> +{
> +	snd_soc_unregister_platform(&mpc5200_audio_dma_platform);
> +}
> +module_exit(mpc5200_soc_platform_exit);

This all looks a bit odd - I'd expect to see the platform registering
with the core when it is probed rather than on module load.  Looking at
the code it appears that you're automatically instantiating the DMA
driver from the node for the DAI?  If that is the case then you ought
to be calling the platform registration functions from the dma_create()
and dma_destroy() functions instead.


More information about the Alsa-devel mailing list