{
const struct key_entry *keymap = toshiba_acpi_keymap;
acpi_handle ec_handle;
- u32 events_type;
- u32 hci_result;
int error;
if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID)) {
if (error)
return error;
- if (toshiba_hotkey_event_type_get(dev, &events_type))
+ if (toshiba_hotkey_event_type_get(dev, &dev->hotkey_event_type))
pr_notice("Unable to query Hotkey Event Type\n");
- dev->hotkey_event_type = events_type;
-
dev->hotkey_dev = input_allocate_device();
if (!dev->hotkey_dev)
return -ENOMEM;
dev->hotkey_dev->phys = "toshiba_acpi/input0";
dev->hotkey_dev->id.bustype = BUS_HOST;
- if (events_type == HCI_SYSTEM_TYPE1 ||
+ if (dev->hotkey_event_type == HCI_SYSTEM_TYPE1 ||
!dev->kbd_function_keys_supported)
keymap = toshiba_acpi_keymap;
- else if (events_type == HCI_SYSTEM_TYPE2 ||
+ else if (dev->hotkey_event_type == HCI_SYSTEM_TYPE2 ||
dev->kbd_function_keys_supported)
keymap = toshiba_acpi_alt_keymap;
else
- pr_info("Unknown event type received %x\n", events_type);
+ pr_info("Unknown event type received %x\n",
+ dev->hotkey_event_type);
error = sparse_keymap_setup(dev->hotkey_dev, keymap, NULL);
if (error)
goto err_free_dev;
*/
if (acpi_has_method(dev->acpi_dev->handle, "INFO"))
dev->info_supported = 1;
- else {
- hci_result = hci_write(dev, HCI_SYSTEM_EVENT, 1);
- if (hci_result == TOS_SUCCESS)
- dev->system_event_supported = 1;
- }
+ else if (hci_write(dev, HCI_SYSTEM_EVENT, 1) == TOS_SUCCESS)
+ dev->system_event_supported = 1;
if (!dev->info_supported && !dev->system_event_supported) {
pr_warn("No hotkey query interface found\n");