[alsa-devel] [PATCH] ASoC: wm8962: Convert to devm_input_allocate_device()

Mark Brown broonie at kernel.org
Thu Apr 25 14:52:34 CEST 2013


On Wed, Apr 24, 2013 at 04:50:48PM +0300, Leon Romanovsky wrote:
> On Thu, Dec 20, 2012 at 4:18 PM, Mark Brown

> >         ret = input_register_device(wm8962->beep);
> >         if (ret != 0) {
> > -               input_free_device(wm8962->beep);
> >                 wm8962->beep = NULL;
> >                 dev_err(codec->dev, "Failed to register beep device\n");
> >         }

> I'm not sure if this patch is correct.
> According to comment of input_free_memory()
> (http://lxr.free-electrons.com/source/drivers/input/input.c#L1825) you
> need to call it if input_register_device failed.

This seems like a bug that should be fixed on the API side, it's really
not what you'd expect a devm function to do, and if you are explicitly
freeing a devm allocated object there's an expectation that you need to
call a corresponding devm cleanup function.
-------------- 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/20130425/5299226a/attachment.sig>


More information about the Alsa-devel mailing list