mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
[ACPI] whitespace
Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
parent
1d492eb413
commit
c65ade4dc8
4 changed files with 32 additions and 67 deletions
|
@ -24,27 +24,23 @@ extern wait_queue_head_t acpi_bus_event_queue;
|
||||||
static int
|
static int
|
||||||
acpi_system_open_event(struct inode *inode, struct file *file)
|
acpi_system_open_event(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
spin_lock_irq (&acpi_system_event_lock);
|
spin_lock_irq(&acpi_system_event_lock);
|
||||||
|
|
||||||
if(event_is_open)
|
if (event_is_open)
|
||||||
goto out_busy;
|
goto out_busy;
|
||||||
|
|
||||||
event_is_open = 1;
|
event_is_open = 1;
|
||||||
|
|
||||||
spin_unlock_irq (&acpi_system_event_lock);
|
spin_unlock_irq(&acpi_system_event_lock);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_busy:
|
out_busy:
|
||||||
spin_unlock_irq (&acpi_system_event_lock);
|
spin_unlock_irq(&acpi_system_event_lock);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
acpi_system_read_event (
|
acpi_system_read_event(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
|
||||||
struct file *file,
|
|
||||||
char __user *buffer,
|
|
||||||
size_t count,
|
|
||||||
loff_t *ppos)
|
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
struct acpi_bus_event event;
|
struct acpi_bus_event event;
|
||||||
|
@ -98,9 +94,7 @@ acpi_system_close_event(struct inode *inode, struct file *file)
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
acpi_system_poll_event(
|
acpi_system_poll_event(struct file *file, poll_table *wait)
|
||||||
struct file *file,
|
|
||||||
poll_table *wait)
|
|
||||||
{
|
{
|
||||||
poll_wait(file, &acpi_bus_event_queue, wait);
|
poll_wait(file, &acpi_bus_event_queue, wait);
|
||||||
if (!list_empty(&acpi_bus_event_list))
|
if (!list_empty(&acpi_bus_event_list))
|
||||||
|
|
|
@ -37,11 +37,8 @@
|
||||||
|
|
||||||
#define ACPI_FAN_COMPONENT 0x00200000
|
#define ACPI_FAN_COMPONENT 0x00200000
|
||||||
#define ACPI_FAN_CLASS "fan"
|
#define ACPI_FAN_CLASS "fan"
|
||||||
#define ACPI_FAN_HID "PNP0C0B"
|
|
||||||
#define ACPI_FAN_DRIVER_NAME "ACPI Fan Driver"
|
#define ACPI_FAN_DRIVER_NAME "ACPI Fan Driver"
|
||||||
#define ACPI_FAN_DEVICE_NAME "Fan"
|
|
||||||
#define ACPI_FAN_FILE_STATE "state"
|
#define ACPI_FAN_FILE_STATE "state"
|
||||||
#define ACPI_FAN_NOTIFY_STATUS 0x80
|
|
||||||
|
|
||||||
#define _COMPONENT ACPI_FAN_COMPONENT
|
#define _COMPONENT ACPI_FAN_COMPONENT
|
||||||
ACPI_MODULE_NAME ("acpi_fan")
|
ACPI_MODULE_NAME ("acpi_fan")
|
||||||
|
@ -56,7 +53,7 @@ static int acpi_fan_remove (struct acpi_device *device, int type);
|
||||||
static struct acpi_driver acpi_fan_driver = {
|
static struct acpi_driver acpi_fan_driver = {
|
||||||
.name = ACPI_FAN_DRIVER_NAME,
|
.name = ACPI_FAN_DRIVER_NAME,
|
||||||
.class = ACPI_FAN_CLASS,
|
.class = ACPI_FAN_CLASS,
|
||||||
.ids = ACPI_FAN_HID,
|
.ids = "PNP0C0B",
|
||||||
.ops = {
|
.ops = {
|
||||||
.add = acpi_fan_add,
|
.add = acpi_fan_add,
|
||||||
.remove = acpi_fan_remove,
|
.remove = acpi_fan_remove,
|
||||||
|
@ -76,7 +73,7 @@ static struct proc_dir_entry *acpi_fan_dir;
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
acpi_fan_read_state (struct seq_file *seq, void *offset)
|
acpi_fan_read_state(struct seq_file *seq, void *offset)
|
||||||
{
|
{
|
||||||
struct acpi_fan *fan = seq->private;
|
struct acpi_fan *fan = seq->private;
|
||||||
int state = 0;
|
int state = 0;
|
||||||
|
@ -99,11 +96,8 @@ static int acpi_fan_state_open_fs(struct inode *inode, struct file *file)
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
acpi_fan_write_state (
|
acpi_fan_write_state(struct file *file, const char __user *buffer,
|
||||||
struct file *file,
|
size_t count, loff_t *ppos)
|
||||||
const char __user *buffer,
|
|
||||||
size_t count,
|
|
||||||
loff_t *ppos)
|
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
struct seq_file *m = (struct seq_file *)file->private_data;
|
struct seq_file *m = (struct seq_file *)file->private_data;
|
||||||
|
@ -138,8 +132,7 @@ static struct file_operations acpi_fan_state_ops = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
acpi_fan_add_fs (
|
acpi_fan_add_fs(struct acpi_device *device)
|
||||||
struct acpi_device *device)
|
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *entry = NULL;
|
struct proc_dir_entry *entry = NULL;
|
||||||
|
|
||||||
|
@ -174,8 +167,7 @@ acpi_fan_add_fs (
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
acpi_fan_remove_fs (
|
acpi_fan_remove_fs(struct acpi_device *device)
|
||||||
struct acpi_device *device)
|
|
||||||
{
|
{
|
||||||
ACPI_FUNCTION_TRACE("acpi_fan_remove_fs");
|
ACPI_FUNCTION_TRACE("acpi_fan_remove_fs");
|
||||||
|
|
||||||
|
@ -195,8 +187,7 @@ acpi_fan_remove_fs (
|
||||||
-------------------------------------------------------------------------- */
|
-------------------------------------------------------------------------- */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
acpi_fan_add (
|
acpi_fan_add(struct acpi_device *device)
|
||||||
struct acpi_device *device)
|
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
struct acpi_fan *fan = NULL;
|
struct acpi_fan *fan = NULL;
|
||||||
|
@ -213,7 +204,7 @@ acpi_fan_add (
|
||||||
memset(fan, 0, sizeof(struct acpi_fan));
|
memset(fan, 0, sizeof(struct acpi_fan));
|
||||||
|
|
||||||
fan->handle = device->handle;
|
fan->handle = device->handle;
|
||||||
strcpy(acpi_device_name(device), ACPI_FAN_DEVICE_NAME);
|
strcpy(acpi_device_name(device), "Fan");
|
||||||
strcpy(acpi_device_class(device), ACPI_FAN_CLASS);
|
strcpy(acpi_device_class(device), ACPI_FAN_CLASS);
|
||||||
acpi_driver_data(device) = fan;
|
acpi_driver_data(device) = fan;
|
||||||
|
|
||||||
|
@ -241,11 +232,9 @@ acpi_fan_add (
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
acpi_fan_remove (
|
acpi_fan_remove(struct acpi_device *device, int type)
|
||||||
struct acpi_device *device,
|
|
||||||
int type)
|
|
||||||
{
|
{
|
||||||
struct acpi_fan *fan = NULL;
|
struct acpi_fan *fan = NULL;
|
||||||
|
|
||||||
ACPI_FUNCTION_TRACE("acpi_fan_remove");
|
ACPI_FUNCTION_TRACE("acpi_fan_remove");
|
||||||
|
|
||||||
|
@ -263,9 +252,9 @@ acpi_fan_remove (
|
||||||
|
|
||||||
|
|
||||||
static int __init
|
static int __init
|
||||||
acpi_fan_init (void)
|
acpi_fan_init(void)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
ACPI_FUNCTION_TRACE("acpi_fan_init");
|
ACPI_FUNCTION_TRACE("acpi_fan_init");
|
||||||
|
|
||||||
|
@ -285,7 +274,7 @@ acpi_fan_init (void)
|
||||||
|
|
||||||
|
|
||||||
static void __exit
|
static void __exit
|
||||||
acpi_fan_exit (void)
|
acpi_fan_exit(void)
|
||||||
{
|
{
|
||||||
ACPI_FUNCTION_TRACE("acpi_fan_exit");
|
ACPI_FUNCTION_TRACE("acpi_fan_exit");
|
||||||
|
|
||||||
|
|
|
@ -529,8 +529,7 @@ acpi_irq_penalty_init(void)
|
||||||
|
|
||||||
static int acpi_irq_balance; /* 0: static, 1: balance */
|
static int acpi_irq_balance; /* 0: static, 1: balance */
|
||||||
|
|
||||||
static int acpi_pci_link_allocate(
|
static int acpi_pci_link_allocate(struct acpi_pci_link *link)
|
||||||
struct acpi_pci_link *link)
|
|
||||||
{
|
{
|
||||||
int irq;
|
int irq;
|
||||||
int i;
|
int i;
|
||||||
|
@ -718,8 +717,7 @@ acpi_pci_link_free_irq(acpi_handle handle)
|
||||||
-------------------------------------------------------------------------- */
|
-------------------------------------------------------------------------- */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
acpi_pci_link_add (
|
acpi_pci_link_add(struct acpi_device *device)
|
||||||
struct acpi_device *device)
|
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
struct acpi_pci_link *link = NULL;
|
struct acpi_pci_link *link = NULL;
|
||||||
|
@ -827,9 +825,7 @@ irqrouter_resume(struct sys_device *dev)
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
acpi_pci_link_remove (
|
acpi_pci_link_remove(struct acpi_device *device, int type)
|
||||||
struct acpi_device *device,
|
|
||||||
int type)
|
|
||||||
{
|
{
|
||||||
struct acpi_pci_link *link = NULL;
|
struct acpi_pci_link *link = NULL;
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,6 @@
|
||||||
|
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
|
|
||||||
#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP
|
|
||||||
#define ACPI_SYSTEM_FILE_SLEEP "sleep"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ACPI_SYSTEM_FILE_ALARM "alarm"
|
|
||||||
#define ACPI_SYSTEM_FILE_WAKEUP_DEVICE "wakeup"
|
|
||||||
|
|
||||||
#define _COMPONENT ACPI_SYSTEM_COMPONENT
|
#define _COMPONENT ACPI_SYSTEM_COMPONENT
|
||||||
ACPI_MODULE_NAME ("sleep")
|
ACPI_MODULE_NAME ("sleep")
|
||||||
|
|
||||||
|
@ -378,14 +371,10 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset)
|
||||||
if (!dev->wakeup.flags.valid)
|
if (!dev->wakeup.flags.valid)
|
||||||
continue;
|
continue;
|
||||||
spin_unlock(&acpi_device_lock);
|
spin_unlock(&acpi_device_lock);
|
||||||
if (dev->wakeup.flags.run_wake)
|
seq_printf(seq, "%4s %4d %s%8s\n",
|
||||||
seq_printf(seq, "%4s %4d %8s\n",
|
dev->pnp.bus_id, (u32) dev->wakeup.sleep_state,
|
||||||
dev->pnp.bus_id, (u32) dev->wakeup.sleep_state,
|
dev->wakeup.flags.run_wake ? "*" : "",
|
||||||
dev->wakeup.state.enabled ? "*enabled" : "*disabled");
|
dev->wakeup.state.enabled ? "enabled" : "disabled");
|
||||||
else
|
|
||||||
seq_printf(seq, "%4s %4d %8s\n",
|
|
||||||
dev->pnp.bus_id, (u32) dev->wakeup.sleep_state,
|
|
||||||
dev->wakeup.state.enabled ? "enabled" : "disabled");
|
|
||||||
spin_lock(&acpi_device_lock);
|
spin_lock(&acpi_device_lock);
|
||||||
}
|
}
|
||||||
spin_unlock(&acpi_device_lock);
|
spin_unlock(&acpi_device_lock);
|
||||||
|
@ -486,28 +475,25 @@ static u32 rtc_handler(void * context)
|
||||||
|
|
||||||
static int acpi_sleep_proc_init(void)
|
static int acpi_sleep_proc_init(void)
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *entry = NULL;
|
struct proc_dir_entry *entry = NULL;
|
||||||
|
|
||||||
if (acpi_disabled)
|
if (acpi_disabled)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP
|
#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP
|
||||||
/* 'sleep' [R/W]*/
|
/* 'sleep' [R/W] */
|
||||||
entry = create_proc_entry(ACPI_SYSTEM_FILE_SLEEP,
|
entry = create_proc_entry("sleep", S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
|
||||||
S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
|
|
||||||
if (entry)
|
if (entry)
|
||||||
entry->proc_fops = &acpi_system_sleep_fops;
|
entry->proc_fops = &acpi_system_sleep_fops;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* 'alarm' [R/W] */
|
/* 'alarm' [R/W] */
|
||||||
entry = create_proc_entry(ACPI_SYSTEM_FILE_ALARM,
|
entry = create_proc_entry("alarm", S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
|
||||||
S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
|
|
||||||
if (entry)
|
if (entry)
|
||||||
entry->proc_fops = &acpi_system_alarm_fops;
|
entry->proc_fops = &acpi_system_alarm_fops;
|
||||||
|
|
||||||
/* 'wakeup device' [R/W]*/
|
/* 'wakeup device' [R/W] */
|
||||||
entry = create_proc_entry(ACPI_SYSTEM_FILE_WAKEUP_DEVICE,
|
entry = create_proc_entry("wakeup", S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
|
||||||
S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
|
|
||||||
if (entry)
|
if (entry)
|
||||||
entry->proc_fops = &acpi_system_wakeup_device_fops;
|
entry->proc_fops = &acpi_system_wakeup_device_fops;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue