aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/platform/x86/toshiba_acpi.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index 4c0e6579c4ca..235185b710c8 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -974,7 +974,7 @@ static void toshiba_acpi_report_hotkey(struct toshiba_acpi_dev *dev,
974static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) 974static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev)
975{ 975{
976 acpi_status status; 976 acpi_status status;
977 acpi_handle ec_handle, handle; 977 acpi_handle ec_handle;
978 int error; 978 int error;
979 u32 hci_result; 979 u32 hci_result;
980 980
@@ -1001,10 +1001,7 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev)
1001 */ 1001 */
1002 status = AE_ERROR; 1002 status = AE_ERROR;
1003 ec_handle = ec_get_handle(); 1003 ec_handle = ec_get_handle();
1004 if (ec_handle) 1004 if (ec_handle && acpi_has_method(ec_handle, "NTFY")) {
1005 status = acpi_get_handle(ec_handle, "NTFY", &handle);
1006
1007 if (ACPI_SUCCESS(status)) {
1008 INIT_WORK(&dev->hotkey_work, toshiba_acpi_hotkey_work); 1005 INIT_WORK(&dev->hotkey_work, toshiba_acpi_hotkey_work);
1009 1006
1010 error = i8042_install_filter(toshiba_acpi_i8042_filter); 1007 error = i8042_install_filter(toshiba_acpi_i8042_filter);
@@ -1020,10 +1017,9 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev)
1020 * Determine hotkey query interface. Prefer using the INFO 1017 * Determine hotkey query interface. Prefer using the INFO
1021 * method when it is available. 1018 * method when it is available.
1022 */ 1019 */
1023 status = acpi_get_handle(dev->acpi_dev->handle, "INFO", &handle); 1020 if (acpi_has_method(dev->acpi_dev->handle, "INFO"))
1024 if (ACPI_SUCCESS(status)) {
1025 dev->info_supported = 1; 1021 dev->info_supported = 1;
1026 } else { 1022 else {
1027 hci_write1(dev, HCI_SYSTEM_EVENT, 1, &hci_result); 1023 hci_write1(dev, HCI_SYSTEM_EVENT, 1, &hci_result);
1028 if (hci_result == HCI_SUCCESS) 1024 if (hci_result == HCI_SUCCESS)
1029 dev->system_event_supported = 1; 1025 dev->system_event_supported = 1;
@@ -1148,15 +1144,10 @@ static int toshiba_acpi_remove(struct acpi_device *acpi_dev)
1148 1144
1149static const char *find_hci_method(acpi_handle handle) 1145static const char *find_hci_method(acpi_handle handle)
1150{ 1146{
1151 acpi_status status; 1147 if (acpi_has_method(handle, "GHCI"))
1152 acpi_handle hci_handle;
1153
1154 status = acpi_get_handle(handle, "GHCI", &hci_handle);
1155 if (ACPI_SUCCESS(status))
1156 return "GHCI"; 1148 return "GHCI";
1157 1149
1158 status = acpi_get_handle(handle, "SPFC", &hci_handle); 1150 if (acpi_has_method(handle, "SPFC"))
1159 if (ACPI_SUCCESS(status))
1160 return "SPFC"; 1151 return "SPFC";
1161 1152
1162 return NULL; 1153 return NULL;