aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
authorAlexey Starikovskiy <astarikovskiy@suse.de>2007-11-19 08:33:45 -0500
committerLen Brown <len.brown@intel.com>2007-11-19 11:21:50 -0500
commitfdcedbba2f98c94bfbac9f6e712ab765f997b8dc (patch)
tree438968c5718fa25eebd332d7ac7a4e2ee4114a29 /drivers/acpi/battery.c
parent2ffbb8377c7a0713baf6644e285adc27a5654582 (diff)
ACPI: Split out control for /proc/acpi entries from battery, ac, and sbs.
Introduce new ACPI_PROCFS_POWER (default Yes) config option and move procfs code in battery, ac, and sbs drivers under it. This is done to allow ACPI_PROCFS to be default No. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> 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 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}