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