diff options
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r-- | drivers/platform/x86/hp-wmi.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index d55bf58ce8f9..34b417848e29 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c | |||
@@ -711,8 +711,10 @@ static int hp_wmi_resume_handler(struct device *device) | |||
711 | static int __init hp_wmi_init(void) | 711 | static int __init hp_wmi_init(void) |
712 | { | 712 | { |
713 | int err; | 713 | int err; |
714 | int event_capable = wmi_has_guid(HPWMI_EVENT_GUID); | ||
715 | int bios_capable = wmi_has_guid(HPWMI_BIOS_GUID); | ||
714 | 716 | ||
715 | if (wmi_has_guid(HPWMI_EVENT_GUID)) { | 717 | if (event_capable) { |
716 | err = wmi_install_notify_handler(HPWMI_EVENT_GUID, | 718 | err = wmi_install_notify_handler(HPWMI_EVENT_GUID, |
717 | hp_wmi_notify, NULL); | 719 | hp_wmi_notify, NULL); |
718 | if (ACPI_FAILURE(err)) | 720 | if (ACPI_FAILURE(err)) |
@@ -724,7 +726,7 @@ static int __init hp_wmi_init(void) | |||
724 | } | 726 | } |
725 | } | 727 | } |
726 | 728 | ||
727 | if (wmi_has_guid(HPWMI_BIOS_GUID)) { | 729 | if (bios_capable) { |
728 | err = platform_driver_register(&hp_wmi_driver); | 730 | err = platform_driver_register(&hp_wmi_driver); |
729 | if (err) | 731 | if (err) |
730 | goto err_driver_reg; | 732 | goto err_driver_reg; |
@@ -738,6 +740,9 @@ static int __init hp_wmi_init(void) | |||
738 | goto err_device_add; | 740 | goto err_device_add; |
739 | } | 741 | } |
740 | 742 | ||
743 | if (!bios_capable && !event_capable) | ||
744 | return -ENODEV; | ||
745 | |||
741 | return 0; | 746 | return 0; |
742 | 747 | ||
743 | err_device_add: | 748 | err_device_add: |