diff options
Diffstat (limited to 'drivers/acpi/ac.c')
-rw-r--r-- | drivers/acpi/ac.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 4537ae4838c4..e0a1b1541362 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c | |||
@@ -50,6 +50,9 @@ ACPI_MODULE_NAME("acpi_ac") | |||
50 | MODULE_DESCRIPTION(ACPI_AC_DRIVER_NAME); | 50 | MODULE_DESCRIPTION(ACPI_AC_DRIVER_NAME); |
51 | MODULE_LICENSE("GPL"); | 51 | MODULE_LICENSE("GPL"); |
52 | 52 | ||
53 | extern struct proc_dir_entry *acpi_lock_ac_dir(void); | ||
54 | extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir); | ||
55 | |||
53 | static int acpi_ac_add(struct acpi_device *device); | 56 | static int acpi_ac_add(struct acpi_device *device); |
54 | static int acpi_ac_remove(struct acpi_device *device, int type); | 57 | static int acpi_ac_remove(struct acpi_device *device, int type); |
55 | static int acpi_ac_open_fs(struct inode *inode, struct file *file); | 58 | static int acpi_ac_open_fs(struct inode *inode, struct file *file); |
@@ -278,17 +281,16 @@ static int acpi_ac_remove(struct acpi_device *device, int type) | |||
278 | 281 | ||
279 | static int __init acpi_ac_init(void) | 282 | static int __init acpi_ac_init(void) |
280 | { | 283 | { |
281 | int result = 0; | 284 | int result; |
282 | 285 | ||
283 | 286 | ||
284 | acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir); | 287 | acpi_ac_dir = acpi_lock_ac_dir(); |
285 | if (!acpi_ac_dir) | 288 | if (!acpi_ac_dir) |
286 | return -ENODEV; | 289 | return -ENODEV; |
287 | acpi_ac_dir->owner = THIS_MODULE; | ||
288 | 290 | ||
289 | result = acpi_bus_register_driver(&acpi_ac_driver); | 291 | result = acpi_bus_register_driver(&acpi_ac_driver); |
290 | if (result < 0) { | 292 | if (result < 0) { |
291 | remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); | 293 | acpi_unlock_ac_dir(acpi_ac_dir); |
292 | return -ENODEV; | 294 | return -ENODEV; |
293 | } | 295 | } |
294 | 296 | ||
@@ -300,7 +302,7 @@ static void __exit acpi_ac_exit(void) | |||
300 | 302 | ||
301 | acpi_bus_unregister_driver(&acpi_ac_driver); | 303 | acpi_bus_unregister_driver(&acpi_ac_driver); |
302 | 304 | ||
303 | remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); | 305 | acpi_unlock_ac_dir(acpi_ac_dir); |
304 | 306 | ||
305 | return; | 307 | return; |
306 | } | 308 | } |