From: Anisse Astier <anisse@astier.eu>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-acpi@vger.kernel.org,
Len Brown <lenb@kernel.org>,
Herton Ronaldo Krzesinski <herton@mandriva.com.br>,
Harald Welte <laforge@gnumonks.org>,
Corentin Chary <corentincj@iksaif.net>,
Carlos Corbacho <carlos@strangeworlds.co.uk>,
Wu Zhangjin <wuzhangjin@gmail.com>
Subject: Re: [PATCH 4/8] Input: hp-wmi - switch to using sparse keymap library
Date: Thu, 3 Dec 2009 10:58:11 +0100 [thread overview]
Message-ID: <20091203105811.06571039@destiny.ordissimo> (raw)
In-Reply-To: <20091202092425.30409.85617.stgit@localhost.localdomain>
Hi Dmitry,
On Wed, 02 Dec 2009 01:24:25 -0800, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote :
> diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
> index c284217..8868610 100644
> --- a/drivers/platform/x86/hp-wmi.c
> +++ b/drivers/platform/x86/hp-wmi.c
> @@ -411,14 +342,29 @@ static int __init hp_wmi_input_setup(void)
> hp_wmi_tablet_state());
> input_sync(hp_wmi_input_dev);
>
> - err = input_register_device(hp_wmi_input_dev);
> + err = wmi_install_notify_handler(HPWMI_EVENT_GUID, hp_wmi_notify, NULL);
> + if (err)
> + goto err_free_keymap;
>
> - if (err) {
> - input_free_device(hp_wmi_input_dev);
> - return err;
> - }
> + err = input_register_device(hp_wmi_input_dev);
> + if (err)
> + goto err_uninstall_notifier;
>
> return 0;
> +
> + err_uninstall_notifier:
> + wmi_remove_notify_handler(HPWMI_EVENT_GUID);
> + err_free_keymap:
> + (hp_wmi_input_dev);
> + err_free_dev:
> + input_free_device(hp_wmi_input_dev);
> + return err;
> +}
> +
> +static void __exit hp_wmi_input_destroy(void)
> +{
> + wmi_remove_notify_handler(HPWMI_EVENT_GUID);
> + input_unregister_device(hp_wmi_input_dev);
> }
I'm not sure if you're calling sparse_keymap_free on the exit path.
>
> static void cleanup_sysfs(struct platform_device *device)
> @@ -564,10 +509,9 @@ static int __init hp_wmi_init(void)
>
> static void __exit hp_wmi_exit(void)
> {
> - if (wmi_has_guid(HPWMI_EVENT_GUID)) {
> - wmi_remove_notify_handler(HPWMI_EVENT_GUID);
> - input_unregister_device(hp_wmi_input_dev);
> - }
> + if (wmi_has_guid(HPWMI_EVENT_GUID))
> + hp_wmi_input_destroy();
> +
> if (hp_wmi_platform_dev) {
> platform_device_del(hp_wmi_platform_dev);
> platform_driver_unregister(&hp_wmi_driver);
>
OK, I'm guilty, I copied my sparse keymap adaptation for msi-wmi from this
patch :-)
--
Anisse
next prev parent reply other threads:[~2009-12-03 9:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-02 9:24 [PATCH 0/8] [RFC/RFT] Implement sparse keymap library Dmitry Torokhov
2009-12-02 9:24 ` [PATCH 1/8] Input: add generic support for sparse keymaps Dmitry Torokhov
2009-12-02 9:24 ` [PATCH 2/8] Input: wistron_btns - switch to using sparse keymap library Dmitry Torokhov
2009-12-02 9:24 ` [PATCH 3/8] Input: dell-wmi " Dmitry Torokhov
2009-12-02 9:24 ` [PATCH 4/8] Input: hp-wmi " Dmitry Torokhov
2009-12-03 9:58 ` Anisse Astier [this message]
2009-12-03 10:03 ` Dmitry Torokhov
2009-12-02 9:24 ` [PATCH 5/8] Input: eeepc-laptop " Dmitry Torokhov
2009-12-02 9:24 ` [PATCH 6/8] Input: asus-laptop " Dmitry Torokhov
2009-12-02 9:24 ` [PATCH 7/8] Input: topstar-laptop " Dmitry Torokhov
2009-12-02 9:24 ` [PATCH 8/8] Input: panasonic-laptop " Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091203105811.06571039@destiny.ordissimo \
--to=anisse@astier.eu \
--cc=carlos@strangeworlds.co.uk \
--cc=corentincj@iksaif.net \
--cc=dmitry.torokhov@gmail.com \
--cc=herton@mandriva.com.br \
--cc=laforge@gnumonks.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=wuzhangjin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox