1 Nov
2011
1 Nov
'11
7:53 a.m.
On Mon, Oct 31, 2011 at 16:28, Girdwood, Liam lrg@ti.com wrote:
On 29 October 2011 19:42, Leon Romanovsky leon@leon.nu wrote:
This driver implements basic functionality, using I²C for the control channel.
Signed-off-by: Leon Romanovsky leon@leon.nu Signed-off-by: Andrey Danin danindrey@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@leon.nu