Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29136
b: refs/heads/master
c: 578b333
h: refs/heads/master
v: v3
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Apr 2, 2006
1 parent 78a4ed3 commit 0a4e171
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d9f749b316ac21cb59ad3e595cbce469b409e1a
refs/heads/master: 578b333bfe8eb1360207a08a53c321822a8f40f3
18 changes: 17 additions & 1 deletion trunk/drivers/acpi/asus_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,8 @@ static int __init asus_hotk_check(void)
return result;
}

static int asus_hotk_found;

static int __init asus_hotk_add(struct acpi_device *device)
{
acpi_status status = AE_OK;
Expand Down Expand Up @@ -1180,6 +1182,8 @@ static int __init asus_hotk_add(struct acpi_device *device)
}
}

asus_hotk_found = 1;

end:
if (result) {
kfree(hotk);
Expand Down Expand Up @@ -1226,7 +1230,19 @@ static int __init asus_acpi_init(void)
asus_proc_dir->owner = THIS_MODULE;

result = acpi_bus_register_driver(&asus_hotk_driver);
if (result < 1) {
if (result < 0) {
remove_proc_entry(PROC_ASUS, acpi_root_dir);
return -ENODEV;
}

/*
* This is a bit of a kludge. We only want this module loaded
* for ASUS systems, but there's currently no way to probe the
* ACPI namespace for ASUS HIDs. So we just return failure if
* we didn't find one, which will cause the module to be
* unloaded.
*/
if (!asus_hotk_found) {
acpi_bus_unregister_driver(&asus_hotk_driver);
remove_proc_entry(PROC_ASUS, acpi_root_dir);
return -ENODEV;
Expand Down

0 comments on commit 0a4e171

Please sign in to comment.