lkml.org 
[lkml]   [2014]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ASoC: sgtl5000: Use devm_ functions
On Sun, Jul 06, 2014 at 12:38:00PM +0530, Himangi Saraogi wrote:

> diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
> index 249fadb..0efd6d6 100644
> --- a/sound/soc/codecs/sgtl5000.c
> +++ b/sound/soc/codecs/sgtl5000.c
> @@ -841,14 +841,15 @@ static int ldo_regulator_register(struct snd_soc_codec *codec,
> struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec);
> struct regulator_config config = { };
>
> - ldo = kzalloc(sizeof(struct ldo_regulator), GFP_KERNEL);
> + ldo = devm_kzalloc(codec->dev, sizeof(struct ldo_regulator),
> + GFP_KERNEL);

You're using the managed functions within the ASoC level probe functions
which doesn't work - devm_ is only usable as part of the driver model
binding and unbinding. All this resource allocation needs to be moved
into the device level probe (which is a better thing anyway) before it
is converted to devm.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-07-11 17:41    [W:1.120 / U:0.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site