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

Leon Romanovsky leon at leon.nu
Tue Nov 1 07:53:05 CET 2011


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:
>> This driver implements basic functionality, using I²C for the control
>> channel.
>>
>> Signed-off-by: Leon Romanovsky <leon at leon.nu>
>> Signed-off-by: Andrey Danin <danindrey at mail.ru>
>>
>
>
> Mostly looks fine, just some minor comments.
Thanks.

>> +       }
>> +       vid2 = (vid2 & 0xff);
>> +
>> +       if ((vid1 != 0x10ec) || (vid2 != id->driver_data)) {
>> +               dev_err(&client->dev, "unknown or wrong codec\n");
>> +               dev_err(&client->dev, "Expected %x:%lx, got %x:%x\n",
>> +                               0x10ec, id->driver_data,
>> +                               vid1, vid2);
>> +               return -ENODEV;
>> +       }
>> +
>> +       alc5632 = devm_kzalloc(&client->dev, sizeof(struct alc5632_priv), GFP_KERNEL);
>> +       if (alc5632 == NULL)
>> +               return -ENOMEM;
>> +
>> +       pdata = client->dev.platform_data;
>> +       if (pdata) {
>> +               alc5632->add_ctrl = pdata->add_ctrl;
>> +               alc5632->jack_det_ctrl = pdata->jack_det_ctrl;
>> +       }
>> +
>> +       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.)

>
> Thanks
>
> Liam
>

-- 
Leon Romanovsky | Independent Linux Consultant
        www.leon.nu | leon at leon.nu


More information about the Alsa-devel mailing list