提交 b096667b 编写于 作者: T Thomas Renninger 提交者: Matthew Garrett

hp-wmi: return -ENODEV if BIOS does not export any supported hp wmi guid

Signed-off-by: NThomas 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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NMatthew Garrett <mjg@redhat.com>
上级 ae42f234
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册