aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ac.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/ac.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/ac.c')
-rw-r--r--drivers/acpi/ac.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 30238f6ff232..76ed4f52bebd 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -27,7 +27,7 @@
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/types.h> 29#include <linux/types.h>
30#ifdef CONFIG_ACPI_PROCFS 30#ifdef CONFIG_ACPI_PROCFS_POWER
31#include <linux/proc_fs.h> 31#include <linux/proc_fs.h>
32#include <linux/seq_file.h> 32#include <linux/seq_file.h>
33#endif 33#endif
@@ -51,7 +51,7 @@ MODULE_AUTHOR("Paul Diefenbaugh");
51MODULE_DESCRIPTION("ACPI AC Adapter Driver"); 51MODULE_DESCRIPTION("ACPI AC Adapter Driver");
52MODULE_LICENSE("GPL"); 52MODULE_LICENSE("GPL");
53 53
54#ifdef CONFIG_ACPI_PROCFS 54#ifdef CONFIG_ACPI_PROCFS_POWER
55extern struct proc_dir_entry *acpi_lock_ac_dir(void); 55extern struct proc_dir_entry *acpi_lock_ac_dir(void);
56extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir); 56extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir);
57static int acpi_ac_open_fs(struct inode *inode, struct file *file); 57static int acpi_ac_open_fs(struct inode *inode, struct file *file);
@@ -86,7 +86,7 @@ struct acpi_ac {
86 86
87#define to_acpi_ac(x) container_of(x, struct acpi_ac, charger); 87#define to_acpi_ac(x) container_of(x, struct acpi_ac, charger);
88 88
89#ifdef CONFIG_ACPI_PROCFS 89#ifdef CONFIG_ACPI_PROCFS_POWER
90static const struct file_operations acpi_ac_fops = { 90static const struct file_operations acpi_ac_fops = {
91 .open = acpi_ac_open_fs, 91 .open = acpi_ac_open_fs,
92 .read = seq_read, 92 .read = seq_read,
@@ -136,7 +136,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
136 return 0; 136 return 0;
137} 137}
138 138
139#ifdef CONFIG_ACPI_PROCFS 139#ifdef CONFIG_ACPI_PROCFS_POWER
140/* -------------------------------------------------------------------------- 140/* --------------------------------------------------------------------------
141 FS Interface (/proc) 141 FS Interface (/proc)
142 -------------------------------------------------------------------------- */ 142 -------------------------------------------------------------------------- */
@@ -275,7 +275,7 @@ static int acpi_ac_add(struct acpi_device *device)
275 if (result) 275 if (result)
276 goto end; 276 goto end;
277 277
278#ifdef CONFIG_ACPI_PROCFS 278#ifdef CONFIG_ACPI_PROCFS_POWER
279 result = acpi_ac_add_fs(device); 279 result = acpi_ac_add_fs(device);
280#endif 280#endif
281 if (result) 281 if (result)
@@ -300,7 +300,7 @@ static int acpi_ac_add(struct acpi_device *device)
300 300
301 end: 301 end:
302 if (result) { 302 if (result) {
303#ifdef CONFIG_ACPI_PROCFS 303#ifdef CONFIG_ACPI_PROCFS_POWER
304 acpi_ac_remove_fs(device); 304 acpi_ac_remove_fs(device);
305#endif 305#endif
306 kfree(ac); 306 kfree(ac);
@@ -339,7 +339,7 @@ static int acpi_ac_remove(struct acpi_device *device, int type)
339 ACPI_ALL_NOTIFY, acpi_ac_notify); 339 ACPI_ALL_NOTIFY, acpi_ac_notify);
340 if (ac->charger.dev) 340 if (ac->charger.dev)
341 power_supply_unregister(&ac->charger); 341 power_supply_unregister(&ac->charger);
342#ifdef CONFIG_ACPI_PROCFS 342#ifdef CONFIG_ACPI_PROCFS_POWER
343 acpi_ac_remove_fs(device); 343 acpi_ac_remove_fs(device);
344#endif 344#endif
345 345
@@ -355,7 +355,7 @@ static int __init acpi_ac_init(void)
355 if (acpi_disabled) 355 if (acpi_disabled)
356 return -ENODEV; 356 return -ENODEV;
357 357
358#ifdef CONFIG_ACPI_PROCFS 358#ifdef CONFIG_ACPI_PROCFS_POWER
359 acpi_ac_dir = acpi_lock_ac_dir(); 359 acpi_ac_dir = acpi_lock_ac_dir();
360 if (!acpi_ac_dir) 360 if (!acpi_ac_dir)
361 return -ENODEV; 361 return -ENODEV;
@@ -363,7 +363,7 @@ static int __init acpi_ac_init(void)
363 363
364 result = acpi_bus_register_driver(&acpi_ac_driver); 364 result = acpi_bus_register_driver(&acpi_ac_driver);
365 if (result < 0) { 365 if (result < 0) {
366#ifdef CONFIG_ACPI_PROCFS 366#ifdef CONFIG_ACPI_PROCFS_POWER
367 acpi_unlock_ac_dir(acpi_ac_dir); 367 acpi_unlock_ac_dir(acpi_ac_dir);
368#endif 368#endif
369 return -ENODEV; 369 return -ENODEV;
@@ -377,7 +377,7 @@ static void __exit acpi_ac_exit(void)
377 377
378 acpi_bus_unregister_driver(&acpi_ac_driver); 378 acpi_bus_unregister_driver(&acpi_ac_driver);
379 379
380#ifdef CONFIG_ACPI_PROCFS 380#ifdef CONFIG_ACPI_PROCFS_POWER
381 acpi_unlock_ac_dir(acpi_ac_dir); 381 acpi_unlock_ac_dir(acpi_ac_dir);
382#endif 382#endif
383 383