aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2007-11-20 01:20:00 -0500
committerLen Brown <len.brown@intel.com>2007-11-20 01:20:00 -0500
commitc2e46d2e2a8e6ed17fac6154ac7e5fa7fe4efb28 (patch)
tree39e4aa997e6a10ef4eebb31487ea15c3c2e70c34 /drivers/acpi/battery.c
parent95b00786f3b8fa99f53931361beeb4c10504ad87 (diff)
parent65ea6520375cc09d19ecb46f03ab7ef70bcf06dd (diff)
Pull procfs-default into release branch
Conflicts: drivers/acpi/sbs.c Signed-off-by: Len Brown <len.brown@intel.com>
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 2e8e790c1180..7d6be23eff89 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
@@ -223,7 +223,7 @@ static enum power_supply_property energy_battery_props[] = {
223 POWER_SUPPLY_PROP_MANUFACTURER, 223 POWER_SUPPLY_PROP_MANUFACTURER,
224}; 224};
225 225
226#ifdef CONFIG_ACPI_PROCFS 226#ifdef CONFIG_ACPI_PROCFS_POWER
227inline char *acpi_battery_units(struct acpi_battery *battery) 227inline char *acpi_battery_units(struct acpi_battery *battery)
228{ 228{
229 return (battery->power_unit)?"mA":"mW"; 229 return (battery->power_unit)?"mA":"mW";
@@ -481,7 +481,7 @@ static int acpi_battery_update(struct acpi_battery *battery)
481 FS Interface (/proc) 481 FS Interface (/proc)
482 -------------------------------------------------------------------------- */ 482 -------------------------------------------------------------------------- */
483 483
484#ifdef CONFIG_ACPI_PROCFS 484#ifdef CONFIG_ACPI_PROCFS_POWER
485static struct proc_dir_entry *acpi_battery_dir; 485static struct proc_dir_entry *acpi_battery_dir;
486 486
487static int acpi_battery_print_info(struct seq_file *seq, int result) 487static int acpi_battery_print_info(struct seq_file *seq, int result)
@@ -788,7 +788,7 @@ static int acpi_battery_add(struct acpi_device *device)
788 acpi_driver_data(device) = battery; 788 acpi_driver_data(device) = battery;
789 mutex_init(&battery->lock); 789 mutex_init(&battery->lock);
790 acpi_battery_update(battery); 790 acpi_battery_update(battery);
791#ifdef CONFIG_ACPI_PROCFS 791#ifdef CONFIG_ACPI_PROCFS_POWER
792 result = acpi_battery_add_fs(device); 792 result = acpi_battery_add_fs(device);
793 if (result) 793 if (result)
794 goto end; 794 goto end;
@@ -806,7 +806,7 @@ static int acpi_battery_add(struct acpi_device *device)
806 device->status.battery_present ? "present" : "absent"); 806 device->status.battery_present ? "present" : "absent");
807 end: 807 end:
808 if (result) { 808 if (result) {
809#ifdef CONFIG_ACPI_PROCFS 809#ifdef CONFIG_ACPI_PROCFS_POWER
810 acpi_battery_remove_fs(device); 810 acpi_battery_remove_fs(device);
811#endif 811#endif
812 kfree(battery); 812 kfree(battery);
@@ -825,7 +825,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
825 status = acpi_remove_notify_handler(device->handle, 825 status = acpi_remove_notify_handler(device->handle,
826 ACPI_ALL_NOTIFY, 826 ACPI_ALL_NOTIFY,
827 acpi_battery_notify); 827 acpi_battery_notify);
828#ifdef CONFIG_ACPI_PROCFS 828#ifdef CONFIG_ACPI_PROCFS_POWER
829 acpi_battery_remove_fs(device); 829 acpi_battery_remove_fs(device);
830#endif 830#endif
831 sysfs_remove_battery(battery); 831 sysfs_remove_battery(battery);
@@ -861,13 +861,13 @@ static int __init acpi_battery_init(void)
861{ 861{
862 if (acpi_disabled) 862 if (acpi_disabled)
863 return -ENODEV; 863 return -ENODEV;
864#ifdef CONFIG_ACPI_PROCFS 864#ifdef CONFIG_ACPI_PROCFS_POWER
865 acpi_battery_dir = acpi_lock_battery_dir(); 865 acpi_battery_dir = acpi_lock_battery_dir();
866 if (!acpi_battery_dir) 866 if (!acpi_battery_dir)
867 return -ENODEV; 867 return -ENODEV;
868#endif 868#endif
869 if (acpi_bus_register_driver(&acpi_battery_driver) < 0) { 869 if (acpi_bus_register_driver(&acpi_battery_driver) < 0) {
870#ifdef CONFIG_ACPI_PROCFS 870#ifdef CONFIG_ACPI_PROCFS_POWER
871 acpi_unlock_battery_dir(acpi_battery_dir); 871 acpi_unlock_battery_dir(acpi_battery_dir);
872#endif 872#endif
873 return -ENODEV; 873 return -ENODEV;
@@ -878,7 +878,7 @@ static int __init acpi_battery_init(void)
878static void __exit acpi_battery_exit(void) 878static void __exit acpi_battery_exit(void)
879{ 879{
880 acpi_bus_unregister_driver(&acpi_battery_driver); 880 acpi_bus_unregister_driver(&acpi_battery_driver);
881#ifdef CONFIG_ACPI_PROCFS 881#ifdef CONFIG_ACPI_PROCFS_POWER
882 acpi_unlock_battery_dir(acpi_battery_dir); 882 acpi_unlock_battery_dir(acpi_battery_dir);
883#endif 883#endif
884} 884}