aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r--drivers/acpi/battery.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 192c244f6190..b871f289dd30 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -31,7 +31,7 @@
31#include <linux/types.h> 31#include <linux/types.h>
32#include <linux/jiffies.h> 32#include <linux/jiffies.h>
33 33
34#ifdef CONFIG_ACPI_PROCFS 34#ifdef CONFIG_ACPI_PROCFS_POWER
35#include <linux/proc_fs.h> 35#include <linux/proc_fs.h>
36#include <linux/seq_file.h> 36#include <linux/seq_file.h>
37#include <asm/uaccess.h> 37#include <asm/uaccess.h>
@@ -63,7 +63,7 @@ static unsigned int cache_time = 1000;
63module_param(cache_time, uint, 0644); 63module_param(cache_time, uint, 0644);
64MODULE_PARM_DESC(cache_time, "cache time in milliseconds"); 64MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
65 65
66#ifdef CONFIG_ACPI_PROCFS 66#ifdef CONFIG_ACPI_PROCFS_POWER
67extern struct proc_dir_entry *acpi_lock_battery_dir(void); 67extern struct proc_dir_entry *acpi_lock_battery_dir(void);
68extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); 68extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir);
69 69
@@ -221,7 +221,7 @@ static enum power_supply_property energy_battery_props[] = {
221 POWER_SUPPLY_PROP_MANUFACTURER, 221 POWER_SUPPLY_PROP_MANUFACTURER,
222}; 222};
223 223
224#ifdef CONFIG_ACPI_PROCFS 224#ifdef CONFIG_ACPI_PROCFS_POWER
225inline char *acpi_battery_units(struct acpi_battery *battery) 225inline char *acpi_battery_units(struct acpi_battery *battery)
226{ 226{
227 return (battery->power_unit)?"mA":"mW"; 227 return (battery->power_unit)?"mA":"mW";
@@ -479,7 +479,7 @@ static int acpi_battery_update(struct acpi_battery *battery)
479 FS Interface (/proc) 479 FS Interface (/proc)
480 -------------------------------------------------------------------------- */ 480 -------------------------------------------------------------------------- */
481 481
482#ifdef CONFIG_ACPI_PROCFS 482#ifdef CONFIG_ACPI_PROCFS_POWER
483static struct proc_dir_entry *acpi_battery_dir; 483static struct proc_dir_entry *acpi_battery_dir;
484 484
485static int acpi_battery_print_info(struct seq_file *seq, int result) 485static int acpi_battery_print_info(struct seq_file *seq, int result)
@@ -786,7 +786,7 @@ static int acpi_battery_add(struct acpi_device *device)
786 acpi_driver_data(device) = battery; 786 acpi_driver_data(device) = battery;
787 mutex_init(&battery->lock); 787 mutex_init(&battery->lock);
788 acpi_battery_update(battery); 788 acpi_battery_update(battery);
789#ifdef CONFIG_ACPI_PROCFS 789#ifdef CONFIG_ACPI_PROCFS_POWER
790 result = acpi_battery_add_fs(device); 790 result = acpi_battery_add_fs(device);
791 if (result) 791 if (result)
792 goto end; 792 goto end;
@@ -804,7 +804,7 @@ static int acpi_battery_add(struct acpi_device *device)
804 device->status.battery_present ? "present" : "absent"); 804 device->status.battery_present ? "present" : "absent");
805 end: 805 end:
806 if (result) { 806 if (result) {
807#ifdef CONFIG_ACPI_PROCFS 807#ifdef CONFIG_ACPI_PROCFS_POWER
808 acpi_battery_remove_fs(device); 808 acpi_battery_remove_fs(device);
809#endif 809#endif
810 kfree(battery); 810 kfree(battery);
@@ -823,7 +823,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
823 status = acpi_remove_notify_handler(device->handle, 823 status = acpi_remove_notify_handler(device->handle,
824 ACPI_ALL_NOTIFY, 824 ACPI_ALL_NOTIFY,
825 acpi_battery_notify); 825 acpi_battery_notify);
826#ifdef CONFIG_ACPI_PROCFS 826#ifdef CONFIG_ACPI_PROCFS_POWER
827 acpi_battery_remove_fs(device); 827 acpi_battery_remove_fs(device);
828#endif 828#endif
829 sysfs_remove_battery(battery); 829 sysfs_remove_battery(battery);
@@ -859,13 +859,13 @@ static int __init acpi_battery_init(void)
859{ 859{
860 if (acpi_disabled) 860 if (acpi_disabled)
861 return -ENODEV; 861 return -ENODEV;
862#ifdef CONFIG_ACPI_PROCFS 862#ifdef CONFIG_ACPI_PROCFS_POWER
863 acpi_battery_dir = acpi_lock_battery_dir(); 863 acpi_battery_dir = acpi_lock_battery_dir();
864 if (!acpi_battery_dir) 864 if (!acpi_battery_dir)
865 return -ENODEV; 865 return -ENODEV;
866#endif 866#endif
867 if (acpi_bus_register_driver(&acpi_battery_driver) < 0) { 867 if (acpi_bus_register_driver(&acpi_battery_driver) < 0) {
868#ifdef CONFIG_ACPI_PROCFS 868#ifdef CONFIG_ACPI_PROCFS_POWER
869 acpi_unlock_battery_dir(acpi_battery_dir); 869 acpi_unlock_battery_dir(acpi_battery_dir);
870#endif 870#endif
871 return -ENODEV; 871 return -ENODEV;
@@ -876,7 +876,7 @@ static int __init acpi_battery_init(void)
876static void __exit acpi_battery_exit(void) 876static void __exit acpi_battery_exit(void)
877{ 877{
878 acpi_bus_unregister_driver(&acpi_battery_driver); 878 acpi_bus_unregister_driver(&acpi_battery_driver);
879#ifdef CONFIG_ACPI_PROCFS 879#ifdef CONFIG_ACPI_PROCFS_POWER
880 acpi_unlock_battery_dir(acpi_battery_dir); 880 acpi_unlock_battery_dir(acpi_battery_dir);
881#endif 881#endif
882} 882}