[alsa-devel] [PATCH 1/2] ASoC: fsl: imx-sgtl5000: Use devm_clk_get()

Mark Brown broonie at opensource.wolfsonmicro.com
Wed Mar 13 11:39:08 CET 2013

On Tue, Mar 12, 2013 at 08:51:29PM -0300, Fabio Estevam wrote:

> -	data->codec_clk = clk_get(&codec_dev->dev, NULL);
> +	data->codec_clk = devm_clk_get(&codec_dev->dev, NULL);
>  	if (IS_ERR(data->codec_clk)) {

This doesn't look right, we're using the CODEC device here but this is
the card driver.  That means that if we unload and reload the card the
clock will get acquired twice.  Should be mostly harmless but still it's
not good practice and would eventually run us out of memory.

Really the CODEC should be doing this but then we get into the fact that
the clock API isn't reliably available and so on...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20130313/4607129e/attachment.sig>

More information about the Alsa-devel mailing list