diff options
author | Azael Avalos <coproscefalo@gmail.com> | 2015-09-19 00:45:34 -0400 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2015-10-03 11:40:44 -0400 |
commit | 10e6aaabc37171a8b2c0f531696db91f5ac442f9 (patch) | |
tree | 284cd44a539b58a8772dccb411699c8e530b4d3b | |
parent | 0b498201e67df447dc81542a71b36db0fae2878d (diff) |
toshiba_acpi: Remove unneeded u32 variables from *setup_keyboard
The function toshiba_acpi_setup_keyboard currently has two u32 variables
used to store the Hotkey Event Type and the result of the HCI_SYSTEM_EVENT
query.
This patch removes those two variables, as we already have a global
variable named "hotkey_event_type" and the result of the HCI_SYSTEM_EVENT
query can be checked directly from the function.
Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
-rw-r--r-- | drivers/platform/x86/toshiba_acpi.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 878f506f6b51..beb709f26fc4 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c | |||
@@ -2381,8 +2381,6 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) | |||
2381 | { | 2381 | { |
2382 | const struct key_entry *keymap = toshiba_acpi_keymap; | 2382 | const struct key_entry *keymap = toshiba_acpi_keymap; |
2383 | acpi_handle ec_handle; | 2383 | acpi_handle ec_handle; |
2384 | u32 events_type; | ||
2385 | u32 hci_result; | ||
2386 | int error; | 2384 | int error; |
2387 | 2385 | ||
2388 | if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID)) { | 2386 | if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID)) { |
@@ -2394,11 +2392,9 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) | |||
2394 | if (error) | 2392 | if (error) |
2395 | return error; | 2393 | return error; |
2396 | 2394 | ||
2397 | if (toshiba_hotkey_event_type_get(dev, &events_type)) | 2395 | if (toshiba_hotkey_event_type_get(dev, &dev->hotkey_event_type)) |
2398 | pr_notice("Unable to query Hotkey Event Type\n"); | 2396 | pr_notice("Unable to query Hotkey Event Type\n"); |
2399 | 2397 | ||
2400 | dev->hotkey_event_type = events_type; | ||
2401 | |||
2402 | dev->hotkey_dev = input_allocate_device(); | 2398 | dev->hotkey_dev = input_allocate_device(); |
2403 | if (!dev->hotkey_dev) | 2399 | if (!dev->hotkey_dev) |
2404 | return -ENOMEM; | 2400 | return -ENOMEM; |
@@ -2407,14 +2403,15 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) | |||
2407 | dev->hotkey_dev->phys = "toshiba_acpi/input0"; | 2403 | dev->hotkey_dev->phys = "toshiba_acpi/input0"; |
2408 | dev->hotkey_dev->id.bustype = BUS_HOST; | 2404 | dev->hotkey_dev->id.bustype = BUS_HOST; |
2409 | 2405 | ||
2410 | if (events_type == HCI_SYSTEM_TYPE1 || | 2406 | if (dev->hotkey_event_type == HCI_SYSTEM_TYPE1 || |
2411 | !dev->kbd_function_keys_supported) | 2407 | !dev->kbd_function_keys_supported) |
2412 | keymap = toshiba_acpi_keymap; | 2408 | keymap = toshiba_acpi_keymap; |
2413 | else if (events_type == HCI_SYSTEM_TYPE2 || | 2409 | else if (dev->hotkey_event_type == HCI_SYSTEM_TYPE2 || |
2414 | dev->kbd_function_keys_supported) | 2410 | dev->kbd_function_keys_supported) |
2415 | keymap = toshiba_acpi_alt_keymap; | 2411 | keymap = toshiba_acpi_alt_keymap; |
2416 | else | 2412 | else |
2417 | pr_info("Unknown event type received %x\n", events_type); | 2413 | pr_info("Unknown event type received %x\n", |
2414 | dev->hotkey_event_type); | ||
2418 | error = sparse_keymap_setup(dev->hotkey_dev, keymap, NULL); | 2415 | error = sparse_keymap_setup(dev->hotkey_dev, keymap, NULL); |
2419 | if (error) | 2416 | if (error) |
2420 | goto err_free_dev; | 2417 | goto err_free_dev; |
@@ -2445,11 +2442,8 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) | |||
2445 | */ | 2442 | */ |
2446 | if (acpi_has_method(dev->acpi_dev->handle, "INFO")) | 2443 | if (acpi_has_method(dev->acpi_dev->handle, "INFO")) |
2447 | dev->info_supported = 1; | 2444 | dev->info_supported = 1; |
2448 | else { | 2445 | else if (hci_write(dev, HCI_SYSTEM_EVENT, 1) == TOS_SUCCESS) |
2449 | hci_result = hci_write(dev, HCI_SYSTEM_EVENT, 1); | 2446 | dev->system_event_supported = 1; |
2450 | if (hci_result == TOS_SUCCESS) | ||
2451 | dev->system_event_supported = 1; | ||
2452 | } | ||
2453 | 2447 | ||
2454 | if (!dev->info_supported && !dev->system_event_supported) { | 2448 | if (!dev->info_supported && !dev->system_event_supported) { |
2455 | pr_warn("No hotkey query interface found\n"); | 2449 | pr_warn("No hotkey query interface found\n"); |