diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c index 852cb07c3dfd..8a8017f9ca91 100644 --- a/drivers/platform/x86/intel-vbtn.c +++ b/drivers/platform/x86/intel-vbtn.c @@ -189,14 +189,6 @@ static void notify_handler(acpi_handle handle, u32 event, void *context) sparse_keymap_report_event(input_dev, event, val, autorelease); } -static bool intel_vbtn_has_buttons(acpi_handle handle) -{ - acpi_status status; - - status = acpi_evaluate_object(handle, "VBDL", NULL, NULL); - return ACPI_SUCCESS(status); -} - /* * There are several laptops (non 2-in-1) models out there which support VGBS, * but simply always return 0, which we translate to SW_TABLET_MODE=1. This in @@ -271,7 +263,7 @@ static int intel_vbtn_probe(struct platform_device *device) acpi_status status; int err; - has_buttons = intel_vbtn_has_buttons(handle); + has_buttons = acpi_has_method(handle, "VBDL"); has_switches = intel_vbtn_has_switches(handle); if (!has_buttons && !has_switches) { @@ -300,6 +292,12 @@ static int intel_vbtn_probe(struct platform_device *device) if (ACPI_FAILURE(status)) return -EBUSY; + if (has_buttons) { + status = acpi_evaluate_object(handle, "VBDL", NULL, NULL); + if (ACPI_FAILURE(status)) + dev_err(&device->dev, "Error VBDL failed with ACPI status %d\n", status); + } + device_init_wakeup(&device->dev, true); /* * In order for system wakeup to work, the EC GPE has to be marked as