aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/dell-wmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86/dell-wmi.c')
-rw-r--r--drivers/platform/x86/dell-wmi.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index 67f3fe71c509..916ccb2b316c 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -238,6 +238,7 @@ static void dell_wmi_notify(u32 value, void *context)
238 input_sync(dell_wmi_input_dev); 238 input_sync(dell_wmi_input_dev);
239 } 239 }
240 } 240 }
241 kfree(obj);
241} 242}
242 243
243 244
@@ -324,37 +325,34 @@ static int __init dell_wmi_init(void)
324 int err; 325 int err;
325 326
326 if (wmi_has_guid(DELL_EVENT_GUID)) { 327 if (wmi_has_guid(DELL_EVENT_GUID)) {
328 printk(KERN_WARNING "dell-wmi: No known WMI GUID found\n");
329 return -ENODEV;
330 }
327 331
328 dmi_walk(find_hk_type, NULL); 332 dmi_walk(find_hk_type, NULL);
329 333 acpi_video = acpi_video_backlight_support();
330 err = dell_wmi_input_setup();
331
332 if (err)
333 return err;
334
335 err = wmi_install_notify_handler(DELL_EVENT_GUID,
336 dell_wmi_notify, NULL);
337 if (err) {
338 input_unregister_device(dell_wmi_input_dev);
339 printk(KERN_ERR "dell-wmi: Unable to register"
340 " notify handler - %d\n", err);
341 return err;
342 }
343 334
344 acpi_video = acpi_video_backlight_support(); 335 err = dell_wmi_input_setup();
336 if (err)
337 return err;
345 338
346 } else 339 err = wmi_install_notify_handler(DELL_EVENT_GUID,
347 printk(KERN_WARNING "dell-wmi: No known WMI GUID found\n"); 340 dell_wmi_notify, NULL);
341 if (err) {
342 input_unregister_device(dell_wmi_input_dev);
343 printk(KERN_ERR
344 "dell-wmi: Unable to register notify handler - %d\n",
345 err);
346 return err;
347 }
348 348
349 return 0; 349 return 0;
350} 350}
351 351
352static void __exit dell_wmi_exit(void) 352static void __exit dell_wmi_exit(void)
353{ 353{
354 if (wmi_has_guid(DELL_EVENT_GUID)) { 354 wmi_remove_notify_handler(DELL_EVENT_GUID);
355 wmi_remove_notify_handler(DELL_EVENT_GUID); 355 input_unregister_device(dell_wmi_input_dev);
356 input_unregister_device(dell_wmi_input_dev);
357 }
358} 356}
359 357
360module_init(dell_wmi_init); 358module_init(dell_wmi_init);