[alsa-devel] [PATCH v3] ASoC: Add new Realtek ALC5632 CODEC driver.

Mark Brown broonie at opensource.wolfsonmicro.com
Tue Nov 1 13:15:04 CET 2011


On Tue, Nov 01, 2011 at 08:53:05AM +0200, Leon Romanovsky wrote:
> On Mon, Oct 31, 2011 at 16:28, Girdwood, Liam <lrg at ti.com> wrote:
> > On 29 October 2011 19:42, Leon Romanovsky <leon at leon.nu> wrote:

> >> +       alc5632 = devm_kzalloc(&client->dev, sizeof(struct alc5632_priv), GFP_KERNEL);
> >> +       if (alc5632 == NULL)
> >> +               return -ENOMEM;

> >> +       alc5632->id = vid2;
> >> +       switch (alc5632->id) {
> >> +       case 0x5c:
> >> +               alc5632_dai.name = "alc5632-hifi";
> >> +               break;
> >> +       default:

> > Need to free resources here.
> Do I need explicit call for this?
> Is this because driver detach not called  in this case?
> http://lxr.free-electrons.com/source/drivers/base/devres.c#L609
> (Memory allocated with this function is automatically freed on driver detach.)

You should be fine due to use of devm_kzalloc() - it's just that that's
a relatively new API.


More information about the Alsa-devel mailing list