eeepc-wmi: rework eeepc_wmi_init and eeepc_wmi_exit
authorCorentin Chary <corentincj@iksaif.net>
Mon, 29 Nov 2010 07:14:05 +0000 (08:14 +0100)
committerMatthew Garrett <mjg@redhat.com>
Fri, 7 Jan 2011 22:03:42 +0000 (17:03 -0500)
commit27c136c8738f6bec10c26aaf0a486f19edef7bf7
tree5de03b4c3b824e9d49ccc3acaf31f8f653eadf0a
parent72135d21b587debcbcc57e0dbcc8bcfa4dacb661
eeepc-wmi: rework eeepc_wmi_init and eeepc_wmi_exit

The old code was using platform_driver.probe to initialize
eeepc_wmi context. That's a mistake because if probe fail,
eeepc_platform_register() won't tell anyone, and chaos will happen.

Wrap add and remove code inside eeepc_wmi_add() / eeepc_wmi_remove(),
and try to use the static platform_device only in eeepc_wmi_init()
and eeepc_wmi_exit()

The code is now very similar to eeepc-laptop, except eeepc_laptop_add
and eeepc_laptop_remove are called from acpi_driver, not module
init/exit functions, but WMI doesn't provide such functionalities (yet ?).

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
drivers/platform/x86/eeepc-wmi.c