diff options
author | Len Brown | 2006-06-16 03:28:57 +0200 |
---|---|---|
committer | Len Brown | 2006-06-16 03:28:57 +0200 |
commit | 69cd291c6bbc6647fe3783257c5a2e076e808f71 (patch) | |
tree | 6f65a2d7d29228129cef09343c485aad64e3a3f1 /drivers/acpi/asus_acpi.c | |
parent | Pull bugzilla-5452 into release branch (diff) | |
parent | ACPI: acpi_bus_unregister_driver() returns void (diff) | |
download | kernel-qcow2-linux-69cd291c6bbc6647fe3783257c5a2e076e808f71.tar.gz kernel-qcow2-linux-69cd291c6bbc6647fe3783257c5a2e076e808f71.tar.xz kernel-qcow2-linux-69cd291c6bbc6647fe3783257c5a2e076e808f71.zip |
Pull acpi_bus_register_driver into release branch
Conflicts:
drivers/acpi/asus_acpi.c
drivers/acpi/scan.c
Diffstat (limited to 'drivers/acpi/asus_acpi.c')
-rw-r--r-- | drivers/acpi/asus_acpi.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index 1a545489e859..90eb3c5a15ca 100644 --- a/drivers/acpi/asus_acpi.c +++ b/drivers/acpi/asus_acpi.c @@ -1119,6 +1119,8 @@ static int asus_hotk_check(void) return result; } +static int asus_hotk_found; + static int asus_hotk_add(struct acpi_device *device) { acpi_status status = AE_OK; @@ -1180,6 +1182,8 @@ static int asus_hotk_add(struct acpi_device *device) } } + asus_hotk_found = 1; + end: if (result) { kfree(hotk); @@ -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; |