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/battery.c | |
parent | d0e5f39f1ee2e55d140064bb6d74c8bad25d71d0 (diff) | |
parent | 635227ee89929a6e2920fc8aa1cd48f7225d3d93 (diff) |
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") | |||
59 | MODULE_DESCRIPTION(ACPI_BATTERY_DRIVER_NAME); | 59 | MODULE_DESCRIPTION(ACPI_BATTERY_DRIVER_NAME); |
60 | MODULE_LICENSE("GPL"); | 60 | MODULE_LICENSE("GPL"); |
61 | 61 | ||
62 | extern struct proc_dir_entry *acpi_lock_battery_dir(void); | ||
63 | extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); | ||
64 | |||
62 | static int acpi_battery_add(struct acpi_device *device); | 65 | static int acpi_battery_add(struct acpi_device *device); |
63 | static int acpi_battery_remove(struct acpi_device *device, int type); | 66 | static int acpi_battery_remove(struct acpi_device *device, int type); |
64 | 67 | ||
@@ -752,17 +755,15 @@ static int acpi_battery_remove(struct acpi_device *device, int type) | |||
752 | 755 | ||
753 | static int __init acpi_battery_init(void) | 756 | static int __init acpi_battery_init(void) |
754 | { | 757 | { |
755 | int result = 0; | 758 | int result; |
756 | |||
757 | 759 | ||
758 | acpi_battery_dir = proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir); | 760 | acpi_battery_dir = acpi_lock_battery_dir(); |
759 | if (!acpi_battery_dir) | 761 | if (!acpi_battery_dir) |
760 | return -ENODEV; | 762 | return -ENODEV; |
761 | acpi_battery_dir->owner = THIS_MODULE; | ||
762 | 763 | ||
763 | result = acpi_bus_register_driver(&acpi_battery_driver); | 764 | result = acpi_bus_register_driver(&acpi_battery_driver); |
764 | if (result < 0) { | 765 | if (result < 0) { |
765 | remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); | 766 | acpi_unlock_battery_dir(acpi_battery_dir); |
766 | return -ENODEV; | 767 | return -ENODEV; |
767 | } | 768 | } |
768 | 769 | ||
@@ -774,7 +775,7 @@ static void __exit acpi_battery_exit(void) | |||
774 | 775 | ||
775 | acpi_bus_unregister_driver(&acpi_battery_driver); | 776 | acpi_bus_unregister_driver(&acpi_battery_driver); |
776 | 777 | ||
777 | remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); | 778 | acpi_unlock_battery_dir(acpi_battery_dir); |
778 | 779 | ||
779 | return; | 780 | return; |
780 | } | 781 | } |