diff options
author | Thomas Renninger <trenn@suse.de> | 2010-07-20 15:19:29 -0700 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2010-08-03 09:48:54 -0400 |
commit | b096667bc3f01e2468df56d4a241dc5231b2f2aa (patch) | |
tree | 71800c7a4214e72c4399897fa9e3ab8bfab983d4 /drivers/platform | |
parent | ae42f234470662aefe65ab59a0ef228f1f6f9c77 (diff) |
hp-wmi: return -ENODEV if BIOS does not export any supported hp wmi guid
Signed-off-by: Thomas Renninger <trenn@suse.de>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-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 d55bf58ce8f..34b417848e2 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) static int __init hp_wmi_init(void) { int err; + int event_capable = wmi_has_guid(HPWMI_EVENT_GUID); + int bios_capable = wmi_has_guid(HPWMI_BIOS_GUID); - if (wmi_has_guid(HPWMI_EVENT_GUID)) { + if (event_capable) { err = wmi_install_notify_handler(HPWMI_EVENT_GUID, hp_wmi_notify, NULL); if (ACPI_FAILURE(err)) @@ -724,7 +726,7 @@ static int __init hp_wmi_init(void) } } - if (wmi_has_guid(HPWMI_BIOS_GUID)) { + if (bios_capable) { err = platform_driver_register(&hp_wmi_driver); if (err) goto err_driver_reg; @@ -738,6 +740,9 @@ static int __init hp_wmi_init(void) goto err_device_add; } + if (!bios_capable && !event_capable) + return -ENODEV; + return 0; err_device_add: |