diff options
-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 f4c87750dbf2..523fff9cf148 100644 --- a/drivers/acpi/asus_acpi.c +++ b/drivers/acpi/asus_acpi.c | |||
@@ -1119,6 +1119,8 @@ static int __init asus_hotk_check(void) | |||
1119 | return result; | 1119 | return result; |
1120 | } | 1120 | } |
1121 | 1121 | ||
1122 | static int asus_hotk_found; | ||
1123 | |||
1122 | static int __init asus_hotk_add(struct acpi_device *device) | 1124 | static int __init asus_hotk_add(struct acpi_device *device) |
1123 | { | 1125 | { |
1124 | acpi_status status = AE_OK; | 1126 | acpi_status status = AE_OK; |
@@ -1180,6 +1182,8 @@ static int __init asus_hotk_add(struct acpi_device *device) | |||
1180 | } | 1182 | } |
1181 | } | 1183 | } |
1182 | 1184 | ||
1185 | asus_hotk_found = 1; | ||
1186 | |||
1183 | end: | 1187 | end: |
1184 | if (result) { | 1188 | if (result) { |
1185 | kfree(hotk); | 1189 | kfree(hotk); |
@@ -1226,7 +1230,19 @@ static int __init asus_acpi_init(void) | |||
1226 | asus_proc_dir->owner = THIS_MODULE; | 1230 | asus_proc_dir->owner = THIS_MODULE; |
1227 | 1231 | ||
1228 | result = acpi_bus_register_driver(&asus_hotk_driver); | 1232 | result = acpi_bus_register_driver(&asus_hotk_driver); |
1229 | if (result < 1) { | 1233 | if (result < 0) { |
1234 | remove_proc_entry(PROC_ASUS, acpi_root_dir); | ||
1235 | return -ENODEV; | ||
1236 | } | ||
1237 | |||
1238 | /* | ||
1239 | * This is a bit of a kludge. We only want this module loaded | ||
1240 | * for ASUS systems, but there's currently no way to probe the | ||
1241 | * ACPI namespace for ASUS HIDs. So we just return failure if | ||
1242 | * we didn't find one, which will cause the module to be | ||
1243 | * unloaded. | ||
1244 | */ | ||
1245 | if (!asus_hotk_found) { | ||
1230 | acpi_bus_unregister_driver(&asus_hotk_driver); | 1246 | acpi_bus_unregister_driver(&asus_hotk_driver); |
1231 | remove_proc_entry(PROC_ASUS, acpi_root_dir); | 1247 | remove_proc_entry(PROC_ASUS, acpi_root_dir); |
1232 | return -ENODEV; | 1248 | return -ENODEV; |