summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ac.c
diff options
context:
space:
mode:
authorRich Townsend <rhdt@bartol.udel.edu>2006-07-01 17:36:54 +0200
committerLen Brown <len.brown@intel.com>2006-07-01 22:36:14 +0200
commit3f86b83243d59bb50caf5938d284d22e10d082a4 (patch)
treeebc93aff4abae0b3f4aa96c19973782eede3411d /drivers/acpi/ac.c
parentPull asus_acpi-0.30 into release branch (diff)
downloadlinux-3f86b83243d59bb50caf5938d284d22e10d082a4.tar.xz
linux-3f86b83243d59bb50caf5938d284d22e10d082a4.zip
ACPI: add support for Smart Battery
Most batteries today are ACPI "Control Method" batteries, but some models ship with the older "Smart Battery" that requires this code. Rich Townsend and Bruno Ducrot were the original authors. Vladimir Lebedev updated to run on latest kernel. http://bugzilla.kernel.org/show_bug.cgi?id=3734 Signed-off-by: Len Brown <len.brown@intel.com>
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 4537ae4838c4..e0a1b1541362 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);
@@ -278,17 +281,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;
}
@@ -300,7 +302,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;
}