diff options
author | Len Brown <len.brown@intel.com> | 2006-07-01 23:21:39 +0200 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-07-01 23:21:39 +0200 |
commit | 309b0f125a22ee34c8f6962677255f7bf6af5e3d (patch) | |
tree | ba5897f4b13d9b3fb35f9fcf1e420537da37c08f /drivers/acpi/battery.c | |
parent | Pull bugzilla-3241 into release branch (diff) | |
parent | ACPI: remove function tracing macros from drivers/acpi/*.c (diff) | |
download | linux-309b0f125a22ee34c8f6962677255f7bf6af5e3d.tar.xz linux-309b0f125a22ee34c8f6962677255f7bf6af5e3d.zip |
Pull smart-battery into release branch
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r-- | drivers/acpi/battery.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index a192d2b47cc8..24bf4dca88cc 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -59,6 +59,9 @@ ACPI_MODULE_NAME("acpi_battery") MODULE_DESCRIPTION(ACPI_BATTERY_DRIVER_NAME); MODULE_LICENSE("GPL"); +extern struct proc_dir_entry *acpi_lock_battery_dir(void); +extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); + static int acpi_battery_add(struct acpi_device *device); static int acpi_battery_remove(struct acpi_device *device, int type); @@ -752,17 +755,15 @@ static int acpi_battery_remove(struct acpi_device *device, int type) static int __init acpi_battery_init(void) { - int result = 0; - + int result; - acpi_battery_dir = proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir); + acpi_battery_dir = acpi_lock_battery_dir(); if (!acpi_battery_dir) return -ENODEV; - acpi_battery_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_battery_driver); if (result < 0) { - remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); + acpi_unlock_battery_dir(acpi_battery_dir); return -ENODEV; } @@ -774,7 +775,7 @@ static void __exit acpi_battery_exit(void) acpi_bus_unregister_driver(&acpi_battery_driver); - remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); + acpi_unlock_battery_dir(acpi_battery_dir); return; } |