err = input_register_device(dell_wmi_input_dev);
if (err)
- goto err_free_keymap;
+ goto err_free_dev;
return 0;
- err_free_keymap:
- sparse_keymap_free(dell_wmi_input_dev);
err_free_dev:
input_free_device(dell_wmi_input_dev);
return err;
}
-static void dell_wmi_input_destroy(void)
-{
- sparse_keymap_free(dell_wmi_input_dev);
- input_unregister_device(dell_wmi_input_dev);
-}
-
/*
* Descriptor buffer is 128 byte long and contains:
*
status = wmi_install_notify_handler(DELL_EVENT_GUID,
dell_wmi_notify, NULL);
if (ACPI_FAILURE(status)) {
- dell_wmi_input_destroy();
+ input_unregister_device(dell_wmi_input_dev);
pr_err("Unable to register notify handler - %d\n", status);
return -ENODEV;
}
if (err) {
pr_err("Failed to enable WMI events\n");
wmi_remove_notify_handler(DELL_EVENT_GUID);
- dell_wmi_input_destroy();
+ input_unregister_device(dell_wmi_input_dev);
return err;
}
}
if (wmi_requires_smbios_request)
dell_wmi_events_set_enabled(false);
wmi_remove_notify_handler(DELL_EVENT_GUID);
- dell_wmi_input_destroy();
+ input_unregister_device(dell_wmi_input_dev);
}
module_exit(dell_wmi_exit);