diff options
author | Len Brown <len.brown@intel.com> | 2006-07-01 17:21:39 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-07-01 17:21:39 -0400 |
commit | 309b0f125a22ee34c8f6962677255f7bf6af5e3d (patch) | |
tree | ba5897f4b13d9b3fb35f9fcf1e420537da37c08f /drivers/acpi/ac.c | |
parent | d0e5f39f1ee2e55d140064bb6d74c8bad25d71d0 (diff) | |
parent | 635227ee89929a6e2920fc8aa1cd48f7225d3d93 (diff) | |
download | linux-309b0f125a22ee34c8f6962677255f7bf6af5e3d.tar.gz linux-309b0f125a22ee34c8f6962677255f7bf6af5e3d.tar.bz2 linux-309b0f125a22ee34c8f6962677255f7bf6af5e3d.zip |
Pull smart-battery into release branch
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 69a98da13913..24ccf81d135f 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c @@ -50,6 +50,9 @@ ACPI_MODULE_NAME("acpi_ac") MODULE_DESCRIPTION(ACPI_AC_DRIVER_NAME); MODULE_LICENSE("GPL"); +extern struct proc_dir_entry *acpi_lock_ac_dir(void); +extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir); + static int acpi_ac_add(struct acpi_device *device); static int acpi_ac_remove(struct acpi_device *device, int type); static 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) static int __init acpi_ac_init(void) { - int result = 0; + int result; - acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir); + acpi_ac_dir = acpi_lock_ac_dir(); if (!acpi_ac_dir) return -ENODEV; - acpi_ac_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_ac_driver); if (result < 0) { - remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); + acpi_unlock_ac_dir(acpi_ac_dir); return -ENODEV; } @@ -302,7 +304,7 @@ static void __exit acpi_ac_exit(void) acpi_bus_unregister_driver(&acpi_ac_driver); - remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); + acpi_unlock_ac_dir(acpi_ac_dir); return; } |