Re: [PATCH] Enable Dell All-In-One volume up/down keys

From: Colin Ian King
Date: Thu Feb 17 2011 - 13:44:17 EST


On Thu, 2011-02-17 at 09:21 -0800, Dmitry Torokhov wrote:
> On Thu, Feb 17, 2011 at 11:10:11AM +0000, Colin Ian King wrote:
> > Thanks for your feedback Dmitry,
> >
[ snip ]
> Looks much better, but I just noticed that we are missing calls to
> sparse_keymap_free(dell_wmi_aio_input_dev) in both probe error handling
> path and in remove method (they shoudl be called before unregistering
> the device).
>
Indeed. Thanks for spotting that. I've also incorporated your
suggestions below too. Much appreciated.

Attached is the re-worked patch.

Colin

> Also, can we have probe routine more streamlined, like this:
>
> static int __init dell_wmi_aio_init(void)
> {
> int err;
> char *guid;
>
> guid = dell_wmi_aio_find();
> if (!guid) {
> pr_error("No known WMI GUID found\n");
> return -ENXIO;
> }
>
> err = dell_wmi_aio_input_setup();
> if (err)
> return err;
>
> err = wmi_install_notify_handler(guid, dell_wmi_aio_notify, NULL);
> if (err) {
> pr_err("Unable to register notify handler - %d\n", err);
> sparse_keymap_free(dell_wmi_aio_input_dev);
> input_unregister_device(dell_wmi_aio_input_dev);
> return err;
> }
>
> return 0;
> }
>
> Thanks.
>