aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorPavel Machek <pavel@suze.cz>2005-08-05 00:37:45 -0400
committerLen Brown <len.brown@intel.com>2005-08-05 00:38:58 -0400
commitc65ade4dc8b486e8c8b9b0a6399789a5428e2039 (patch)
treeb12aa0cce89523e67e9c5a74343e195c797636d5 /drivers/acpi
parent1d492eb41371d9a5145651e8eb64bea1042a4057 (diff)
[ACPI] whitespace
Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/event.c18
-rw-r--r--drivers/acpi/fan.c37
-rw-r--r--drivers/acpi/pci_link.c10
-rw-r--r--drivers/acpi/sleep/proc.c34
4 files changed, 32 insertions, 67 deletions
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index 43c49f66a328..ce8d3eec3911 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -24,27 +24,23 @@ extern wait_queue_head_t acpi_bus_event_queue;
24static int 24static int
25acpi_system_open_event(struct inode *inode, struct file *file) 25acpi_system_open_event(struct inode *inode, struct file *file)
26{ 26{
27 spin_lock_irq (&acpi_system_event_lock); 27 spin_lock_irq(&acpi_system_event_lock);
28 28
29 if(event_is_open) 29 if (event_is_open)
30 goto out_busy; 30 goto out_busy;
31 31
32 event_is_open = 1; 32 event_is_open = 1;
33 33
34 spin_unlock_irq (&acpi_system_event_lock); 34 spin_unlock_irq(&acpi_system_event_lock);
35 return 0; 35 return 0;
36 36
37out_busy: 37out_busy:
38 spin_unlock_irq (&acpi_system_event_lock); 38 spin_unlock_irq(&acpi_system_event_lock);
39 return -EBUSY; 39 return -EBUSY;
40} 40}
41 41
42static ssize_t 42static ssize_t
43acpi_system_read_event ( 43acpi_system_read_event(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
44 struct file *file,
45 char __user *buffer,
46 size_t count,
47 loff_t *ppos)
48{ 44{
49 int result = 0; 45 int result = 0;
50 struct acpi_bus_event event; 46 struct acpi_bus_event event;
@@ -98,9 +94,7 @@ acpi_system_close_event(struct inode *inode, struct file *file)
98} 94}
99 95
100static unsigned int 96static unsigned int
101acpi_system_poll_event( 97acpi_system_poll_event(struct file *file, poll_table *wait)
102 struct file *file,
103 poll_table *wait)
104{ 98{
105 poll_wait(file, &acpi_bus_event_queue, wait); 99 poll_wait(file, &acpi_bus_event_queue, wait);
106 if (!list_empty(&acpi_bus_event_list)) 100 if (!list_empty(&acpi_bus_event_list))
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 14192ee55f8f..2ee1d061013f 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -37,11 +37,8 @@
37 37
38#define ACPI_FAN_COMPONENT 0x00200000 38#define ACPI_FAN_COMPONENT 0x00200000
39#define ACPI_FAN_CLASS "fan" 39#define ACPI_FAN_CLASS "fan"
40#define ACPI_FAN_HID "PNP0C0B"
41#define ACPI_FAN_DRIVER_NAME "ACPI Fan Driver" 40#define ACPI_FAN_DRIVER_NAME "ACPI Fan Driver"
42#define ACPI_FAN_DEVICE_NAME "Fan"
43#define ACPI_FAN_FILE_STATE "state" 41#define ACPI_FAN_FILE_STATE "state"
44#define ACPI_FAN_NOTIFY_STATUS 0x80
45 42
46#define _COMPONENT ACPI_FAN_COMPONENT 43#define _COMPONENT ACPI_FAN_COMPONENT
47ACPI_MODULE_NAME ("acpi_fan") 44ACPI_MODULE_NAME ("acpi_fan")
@@ -56,7 +53,7 @@ static int acpi_fan_remove (struct acpi_device *device, int type);
56static struct acpi_driver acpi_fan_driver = { 53static struct acpi_driver acpi_fan_driver = {
57 .name = ACPI_FAN_DRIVER_NAME, 54 .name = ACPI_FAN_DRIVER_NAME,
58 .class = ACPI_FAN_CLASS, 55 .class = ACPI_FAN_CLASS,
59 .ids = ACPI_FAN_HID, 56 .ids = "PNP0C0B",
60 .ops = { 57 .ops = {
61 .add = acpi_fan_add, 58 .add = acpi_fan_add,
62 .remove = acpi_fan_remove, 59 .remove = acpi_fan_remove,
@@ -76,7 +73,7 @@ static struct proc_dir_entry *acpi_fan_dir;
76 73
77 74
78static int 75static int
79acpi_fan_read_state (struct seq_file *seq, void *offset) 76acpi_fan_read_state(struct seq_file *seq, void *offset)
80{ 77{
81 struct acpi_fan *fan = seq->private; 78 struct acpi_fan *fan = seq->private;
82 int state = 0; 79 int state = 0;
@@ -99,11 +96,8 @@ static int acpi_fan_state_open_fs(struct inode *inode, struct file *file)
99} 96}
100 97
101static ssize_t 98static ssize_t
102acpi_fan_write_state ( 99acpi_fan_write_state(struct file *file, const char __user *buffer,
103 struct file *file, 100 size_t count, loff_t *ppos)
104 const char __user *buffer,
105 size_t count,
106 loff_t *ppos)
107{ 101{
108 int result = 0; 102 int result = 0;
109 struct seq_file *m = (struct seq_file *)file->private_data; 103 struct seq_file *m = (struct seq_file *)file->private_data;
@@ -138,8 +132,7 @@ static struct file_operations acpi_fan_state_ops = {
138}; 132};
139 133
140static int 134static int
141acpi_fan_add_fs ( 135acpi_fan_add_fs(struct acpi_device *device)
142 struct acpi_device *device)
143{ 136{
144 struct proc_dir_entry *entry = NULL; 137 struct proc_dir_entry *entry = NULL;
145 138
@@ -174,8 +167,7 @@ acpi_fan_add_fs (
174 167
175 168
176static int 169static int
177acpi_fan_remove_fs ( 170acpi_fan_remove_fs(struct acpi_device *device)
178 struct acpi_device *device)
179{ 171{
180 ACPI_FUNCTION_TRACE("acpi_fan_remove_fs"); 172 ACPI_FUNCTION_TRACE("acpi_fan_remove_fs");
181 173
@@ -195,8 +187,7 @@ acpi_fan_remove_fs (
195 -------------------------------------------------------------------------- */ 187 -------------------------------------------------------------------------- */
196 188
197static int 189static int
198acpi_fan_add ( 190acpi_fan_add(struct acpi_device *device)
199 struct acpi_device *device)
200{ 191{
201 int result = 0; 192 int result = 0;
202 struct acpi_fan *fan = NULL; 193 struct acpi_fan *fan = NULL;
@@ -213,7 +204,7 @@ acpi_fan_add (
213 memset(fan, 0, sizeof(struct acpi_fan)); 204 memset(fan, 0, sizeof(struct acpi_fan));
214 205
215 fan->handle = device->handle; 206 fan->handle = device->handle;
216 strcpy(acpi_device_name(device), ACPI_FAN_DEVICE_NAME); 207 strcpy(acpi_device_name(device), "Fan");
217 strcpy(acpi_device_class(device), ACPI_FAN_CLASS); 208 strcpy(acpi_device_class(device), ACPI_FAN_CLASS);
218 acpi_driver_data(device) = fan; 209 acpi_driver_data(device) = fan;
219 210
@@ -241,11 +232,9 @@ end:
241 232
242 233
243static int 234static int
244acpi_fan_remove ( 235acpi_fan_remove(struct acpi_device *device, int type)
245 struct acpi_device *device,
246 int type)
247{ 236{
248 struct acpi_fan *fan = NULL; 237 struct acpi_fan *fan = NULL;
249 238
250 ACPI_FUNCTION_TRACE("acpi_fan_remove"); 239 ACPI_FUNCTION_TRACE("acpi_fan_remove");
251 240
@@ -263,9 +252,9 @@ acpi_fan_remove (
263 252
264 253
265static int __init 254static int __init
266acpi_fan_init (void) 255acpi_fan_init(void)
267{ 256{
268 int result = 0; 257 int result = 0;
269 258
270 ACPI_FUNCTION_TRACE("acpi_fan_init"); 259 ACPI_FUNCTION_TRACE("acpi_fan_init");
271 260
@@ -285,7 +274,7 @@ acpi_fan_init (void)
285 274
286 275
287static void __exit 276static void __exit
288acpi_fan_exit (void) 277acpi_fan_exit(void)
289{ 278{
290 ACPI_FUNCTION_TRACE("acpi_fan_exit"); 279 ACPI_FUNCTION_TRACE("acpi_fan_exit");
291 280
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index 26aa3829f1de..e8334ce84d84 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -529,8 +529,7 @@ acpi_irq_penalty_init(void)
529 529
530static int acpi_irq_balance; /* 0: static, 1: balance */ 530static int acpi_irq_balance; /* 0: static, 1: balance */
531 531
532static int acpi_pci_link_allocate( 532static int acpi_pci_link_allocate(struct acpi_pci_link *link)
533 struct acpi_pci_link *link)
534{ 533{
535 int irq; 534 int irq;
536 int i; 535 int i;
@@ -718,8 +717,7 @@ acpi_pci_link_free_irq(acpi_handle handle)
718 -------------------------------------------------------------------------- */ 717 -------------------------------------------------------------------------- */
719 718
720static int 719static int
721acpi_pci_link_add ( 720acpi_pci_link_add(struct acpi_device *device)
722 struct acpi_device *device)
723{ 721{
724 int result = 0; 722 int result = 0;
725 struct acpi_pci_link *link = NULL; 723 struct acpi_pci_link *link = NULL;
@@ -827,9 +825,7 @@ irqrouter_resume(struct sys_device *dev)
827 825
828 826
829static int 827static int
830acpi_pci_link_remove ( 828acpi_pci_link_remove(struct acpi_device *device, int type)
831 struct acpi_device *device,
832 int type)
833{ 829{
834 struct acpi_pci_link *link = NULL; 830 struct acpi_pci_link *link = NULL;
835 831
diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c
index 1be99f0996d6..a962fc24f704 100644
--- a/drivers/acpi/sleep/proc.c
+++ b/drivers/acpi/sleep/proc.c
@@ -13,13 +13,6 @@
13 13
14#include "sleep.h" 14#include "sleep.h"
15 15
16#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP
17#define ACPI_SYSTEM_FILE_SLEEP "sleep"
18#endif
19
20#define ACPI_SYSTEM_FILE_ALARM "alarm"
21#define ACPI_SYSTEM_FILE_WAKEUP_DEVICE "wakeup"
22
23#define _COMPONENT ACPI_SYSTEM_COMPONENT 16#define _COMPONENT ACPI_SYSTEM_COMPONENT
24ACPI_MODULE_NAME ("sleep") 17ACPI_MODULE_NAME ("sleep")
25 18
@@ -378,14 +371,10 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset)
378 if (!dev->wakeup.flags.valid) 371 if (!dev->wakeup.flags.valid)
379 continue; 372 continue;
380 spin_unlock(&acpi_device_lock); 373 spin_unlock(&acpi_device_lock);
381 if (dev->wakeup.flags.run_wake) 374 seq_printf(seq, "%4s %4d %s%8s\n",
382 seq_printf(seq, "%4s %4d %8s\n", 375 dev->pnp.bus_id, (u32) dev->wakeup.sleep_state,
383 dev->pnp.bus_id, (u32) dev->wakeup.sleep_state, 376 dev->wakeup.flags.run_wake ? "*" : "",
384 dev->wakeup.state.enabled ? "*enabled" : "*disabled"); 377 dev->wakeup.state.enabled ? "enabled" : "disabled");
385 else
386 seq_printf(seq, "%4s %4d %8s\n",
387 dev->pnp.bus_id, (u32) dev->wakeup.sleep_state,
388 dev->wakeup.state.enabled ? "enabled" : "disabled");
389 spin_lock(&acpi_device_lock); 378 spin_lock(&acpi_device_lock);
390 } 379 }
391 spin_unlock(&acpi_device_lock); 380 spin_unlock(&acpi_device_lock);
@@ -486,28 +475,25 @@ static u32 rtc_handler(void * context)
486 475
487static int acpi_sleep_proc_init(void) 476static int acpi_sleep_proc_init(void)
488{ 477{
489 struct proc_dir_entry *entry = NULL; 478 struct proc_dir_entry *entry = NULL;
490 479
491 if (acpi_disabled) 480 if (acpi_disabled)
492 return 0; 481 return 0;
493 482
494#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP 483#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP
495 /* 'sleep' [R/W]*/ 484 /* 'sleep' [R/W] */
496 entry = create_proc_entry(ACPI_SYSTEM_FILE_SLEEP, 485 entry = create_proc_entry("sleep", S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
497 S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
498 if (entry) 486 if (entry)
499 entry->proc_fops = &acpi_system_sleep_fops; 487 entry->proc_fops = &acpi_system_sleep_fops;
500#endif 488#endif
501 489
502 /* 'alarm' [R/W] */ 490 /* 'alarm' [R/W] */
503 entry = create_proc_entry(ACPI_SYSTEM_FILE_ALARM, 491 entry = create_proc_entry("alarm", S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
504 S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
505 if (entry) 492 if (entry)
506 entry->proc_fops = &acpi_system_alarm_fops; 493 entry->proc_fops = &acpi_system_alarm_fops;
507 494
508 /* 'wakeup device' [R/W]*/ 495 /* 'wakeup device' [R/W] */
509 entry = create_proc_entry(ACPI_SYSTEM_FILE_WAKEUP_DEVICE, 496 entry = create_proc_entry("wakeup", S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
510 S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
511 if (entry) 497 if (entry)
512 entry->proc_fops = &acpi_system_wakeup_device_fops; 498 entry->proc_fops = &acpi_system_wakeup_device_fops;
513 499