Commit d550d98d authored by Patrick Mochel's avatar Patrick Mochel Committed by Len Brown

ACPI: delete tracing macros from drivers/acpi/*.c

Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent d7fa2589
...@@ -84,19 +84,18 @@ static int acpi_ac_get_state(struct acpi_ac *ac) ...@@ -84,19 +84,18 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE("acpi_ac_get_state");
if (!ac) if (!ac)
return_VALUE(-EINVAL); return -EINVAL;
status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state); status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state")); ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state"));
ac->state = ACPI_AC_STATUS_UNKNOWN; ac->state = ACPI_AC_STATUS_UNKNOWN;
return_VALUE(-ENODEV); return -ENODEV;
} }
return_VALUE(0); return 0;
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
...@@ -109,14 +108,13 @@ static int acpi_ac_seq_show(struct seq_file *seq, void *offset) ...@@ -109,14 +108,13 @@ static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
{ {
struct acpi_ac *ac = (struct acpi_ac *)seq->private; struct acpi_ac *ac = (struct acpi_ac *)seq->private;
ACPI_FUNCTION_TRACE("acpi_ac_seq_show");
if (!ac) if (!ac)
return_VALUE(0); return 0;
if (acpi_ac_get_state(ac)) { if (acpi_ac_get_state(ac)) {
seq_puts(seq, "ERROR: Unable to read AC Adapter state\n"); seq_puts(seq, "ERROR: Unable to read AC Adapter state\n");
return_VALUE(0); return 0;
} }
seq_puts(seq, "state: "); seq_puts(seq, "state: ");
...@@ -132,7 +130,7 @@ static int acpi_ac_seq_show(struct seq_file *seq, void *offset) ...@@ -132,7 +130,7 @@ static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
break; break;
} }
return_VALUE(0); return 0;
} }
static int acpi_ac_open_fs(struct inode *inode, struct file *file) static int acpi_ac_open_fs(struct inode *inode, struct file *file)
...@@ -144,13 +142,12 @@ static int acpi_ac_add_fs(struct acpi_device *device) ...@@ -144,13 +142,12 @@ static int acpi_ac_add_fs(struct acpi_device *device)
{ {
struct proc_dir_entry *entry = NULL; struct proc_dir_entry *entry = NULL;
ACPI_FUNCTION_TRACE("acpi_ac_add_fs");
if (!acpi_device_dir(device)) { if (!acpi_device_dir(device)) {
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
acpi_ac_dir); acpi_ac_dir);
if (!acpi_device_dir(device)) if (!acpi_device_dir(device))
return_VALUE(-ENODEV); return -ENODEV;
acpi_device_dir(device)->owner = THIS_MODULE; acpi_device_dir(device)->owner = THIS_MODULE;
} }
...@@ -158,19 +155,18 @@ static int acpi_ac_add_fs(struct acpi_device *device) ...@@ -158,19 +155,18 @@ static int acpi_ac_add_fs(struct acpi_device *device)
entry = create_proc_entry(ACPI_AC_FILE_STATE, entry = create_proc_entry(ACPI_AC_FILE_STATE,
S_IRUGO, acpi_device_dir(device)); S_IRUGO, acpi_device_dir(device));
if (!entry) if (!entry)
return_VALUE(-ENODEV); return -ENODEV;
else { else {
entry->proc_fops = &acpi_ac_fops; entry->proc_fops = &acpi_ac_fops;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
entry->owner = THIS_MODULE; entry->owner = THIS_MODULE;
} }
return_VALUE(0); return 0;
} }
static int acpi_ac_remove_fs(struct acpi_device *device) static int acpi_ac_remove_fs(struct acpi_device *device)
{ {
ACPI_FUNCTION_TRACE("acpi_ac_remove_fs");
if (acpi_device_dir(device)) { if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_AC_FILE_STATE, acpi_device_dir(device)); remove_proc_entry(ACPI_AC_FILE_STATE, acpi_device_dir(device));
...@@ -179,7 +175,7 @@ static int acpi_ac_remove_fs(struct acpi_device *device) ...@@ -179,7 +175,7 @@ static int acpi_ac_remove_fs(struct acpi_device *device)
acpi_device_dir(device) = NULL; acpi_device_dir(device) = NULL;
} }
return_VALUE(0); return 0;
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
...@@ -191,13 +187,12 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data) ...@@ -191,13 +187,12 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
struct acpi_ac *ac = (struct acpi_ac *)data; struct acpi_ac *ac = (struct acpi_ac *)data;
struct acpi_device *device = NULL; struct acpi_device *device = NULL;
ACPI_FUNCTION_TRACE("acpi_ac_notify");
if (!ac) if (!ac)
return_VOID; return;
if (acpi_bus_get_device(ac->handle, &device)) if (acpi_bus_get_device(ac->handle, &device))
return_VOID; return;
switch (event) { switch (event) {
case ACPI_AC_NOTIFY_STATUS: case ACPI_AC_NOTIFY_STATUS:
...@@ -210,7 +205,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data) ...@@ -210,7 +205,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
break; break;
} }
return_VOID; return;
} }
static int acpi_ac_add(struct acpi_device *device) static int acpi_ac_add(struct acpi_device *device)
...@@ -219,14 +214,13 @@ static int acpi_ac_add(struct acpi_device *device) ...@@ -219,14 +214,13 @@ static int acpi_ac_add(struct acpi_device *device)
acpi_status status = AE_OK; acpi_status status = AE_OK;
struct acpi_ac *ac = NULL; struct acpi_ac *ac = NULL;
ACPI_FUNCTION_TRACE("acpi_ac_add");
if (!device) if (!device)
return_VALUE(-EINVAL); return -EINVAL;
ac = kmalloc(sizeof(struct acpi_ac), GFP_KERNEL); ac = kmalloc(sizeof(struct acpi_ac), GFP_KERNEL);
if (!ac) if (!ac)
return_VALUE(-ENOMEM); return -ENOMEM;
memset(ac, 0, sizeof(struct acpi_ac)); memset(ac, 0, sizeof(struct acpi_ac));
ac->handle = device->handle; ac->handle = device->handle;
...@@ -260,7 +254,7 @@ static int acpi_ac_add(struct acpi_device *device) ...@@ -260,7 +254,7 @@ static int acpi_ac_add(struct acpi_device *device)
kfree(ac); kfree(ac);
} }
return_VALUE(result); return result;
} }
static int acpi_ac_remove(struct acpi_device *device, int type) static int acpi_ac_remove(struct acpi_device *device, int type)
...@@ -268,10 +262,9 @@ static int acpi_ac_remove(struct acpi_device *device, int type) ...@@ -268,10 +262,9 @@ static int acpi_ac_remove(struct acpi_device *device, int type)
acpi_status status = AE_OK; acpi_status status = AE_OK;
struct acpi_ac *ac = NULL; struct acpi_ac *ac = NULL;
ACPI_FUNCTION_TRACE("acpi_ac_remove");
if (!device || !acpi_driver_data(device)) if (!device || !acpi_driver_data(device))
return_VALUE(-EINVAL); return -EINVAL;
ac = (struct acpi_ac *)acpi_driver_data(device); ac = (struct acpi_ac *)acpi_driver_data(device);
...@@ -282,38 +275,36 @@ static int acpi_ac_remove(struct acpi_device *device, int type) ...@@ -282,38 +275,36 @@ static int acpi_ac_remove(struct acpi_device *device, int type)
kfree(ac); kfree(ac);
return_VALUE(0); return 0;
} }
static int __init acpi_ac_init(void) static int __init acpi_ac_init(void)
{ {
int result = 0; int result = 0;
ACPI_FUNCTION_TRACE("acpi_ac_init");
acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir); acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir);
if (!acpi_ac_dir) if (!acpi_ac_dir)
return_VALUE(-ENODEV); return -ENODEV;
acpi_ac_dir->owner = THIS_MODULE; acpi_ac_dir->owner = THIS_MODULE;
result = acpi_bus_register_driver(&acpi_ac_driver); result = acpi_bus_register_driver(&acpi_ac_driver);
if (result < 0) { if (result < 0) {
remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
return_VALUE(-ENODEV); return -ENODEV;
} }
return_VALUE(0); return 0;
} }
static void __exit acpi_ac_exit(void) static void __exit acpi_ac_exit(void)
{ {
ACPI_FUNCTION_TRACE("acpi_ac_exit");
acpi_bus_unregister_driver(&acpi_ac_driver); acpi_bus_unregister_driver(&acpi_ac_driver);
remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
return_VOID; return;
} }
module_init(acpi_ac_init); module_init(acpi_ac_init);
......
...@@ -85,12 +85,11 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device) ...@@ -85,12 +85,11 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
struct acpi_resource *resource = NULL; struct acpi_resource *resource = NULL;
struct acpi_resource_address64 address64; struct acpi_resource_address64 address64;
ACPI_FUNCTION_TRACE("acpi_memory_get_device_resources");
/* Get the range from the _CRS */ /* Get the range from the _CRS */
status = acpi_get_current_resources(mem_device->handle, &buffer); status = acpi_get_current_resources(mem_device->handle, &buffer);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return_VALUE(-EINVAL); return -EINVAL;
resource = (struct acpi_resource *)buffer.pointer; resource = (struct acpi_resource *)buffer.pointer;
status = acpi_resource_to_address64(resource, &address64); status = acpi_resource_to_address64(resource, &address64);
...@@ -106,7 +105,7 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device) ...@@ -106,7 +105,7 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
} }
acpi_os_free(buffer.pointer); acpi_os_free(buffer.pointer);
return_VALUE(0); return 0;
} }
static int static int
...@@ -118,7 +117,6 @@ acpi_memory_get_device(acpi_handle handle, ...@@ -118,7 +117,6 @@ acpi_memory_get_device(acpi_handle handle,
struct acpi_device *device = NULL; struct acpi_device *device = NULL;
struct acpi_device *pdevice = NULL; struct acpi_device *pdevice = NULL;
ACPI_FUNCTION_TRACE("acpi_memory_get_device");
if (!acpi_bus_get_device(handle, &device) && device) if (!acpi_bus_get_device(handle, &device) && device)
goto end; goto end;
...@@ -126,14 +124,14 @@ acpi_memory_get_device(acpi_handle handle, ...@@ -126,14 +124,14 @@ acpi_memory_get_device(acpi_handle handle,
status = acpi_get_parent(handle, &phandle); status = acpi_get_parent(handle, &phandle);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Cannot find acpi parent")); ACPI_EXCEPTION((AE_INFO, status, "Cannot find acpi parent"));
return_VALUE(-EINVAL); return -EINVAL;
} }
/* Get the parent device */ /* Get the parent device */
status = acpi_bus_get_device(phandle, &pdevice); status = acpi_bus_get_device(phandle, &pdevice);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Cannot get acpi bus device")); ACPI_EXCEPTION((AE_INFO, status, "Cannot get acpi bus device"));
return_VALUE(-EINVAL); return -EINVAL;
} }
/* /*
...@@ -143,29 +141,28 @@ acpi_memory_get_device(acpi_handle handle, ...@@ -143,29 +141,28 @@ acpi_memory_get_device(acpi_handle handle,
status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE); status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Cannot add acpi bus")); ACPI_EXCEPTION((AE_INFO, status, "Cannot add acpi bus"));
return_VALUE(-EINVAL); return -EINVAL;
} }
end: end:
*mem_device = acpi_driver_data(device); *mem_device = acpi_driver_data(device);
if (!(*mem_device)) { if (!(*mem_device)) {
printk(KERN_ERR "\n driver data not found"); printk(KERN_ERR "\n driver data not found");
return_VALUE(-ENODEV); return -ENODEV;
} }
return_VALUE(0); return 0;
} }
static int acpi_memory_check_device(struct acpi_memory_device *mem_device) static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
{ {
unsigned long current_status; unsigned long current_status;
ACPI_FUNCTION_TRACE("acpi_memory_check_device");
/* Get device present/absent information from the _STA */ /* Get device present/absent information from the _STA */
if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA", if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA",
NULL, &current_status))) NULL, &current_status)))
return_VALUE(-ENODEV); return -ENODEV;
/* /*
* Check for device status. Device should be * Check for device status. Device should be
* present/enabled/functioning. * present/enabled/functioning.
...@@ -173,16 +170,15 @@ static int acpi_memory_check_device(struct acpi_memory_device *mem_device) ...@@ -173,16 +170,15 @@ static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
if (!((current_status & ACPI_MEMORY_STA_PRESENT) if (!((current_status & ACPI_MEMORY_STA_PRESENT)
&& (current_status & ACPI_MEMORY_STA_ENABLED) && (current_status & ACPI_MEMORY_STA_ENABLED)
&& (current_status & ACPI_MEMORY_STA_FUNCTIONAL))) && (current_status & ACPI_MEMORY_STA_FUNCTIONAL)))
return_VALUE(-ENODEV); return -ENODEV;
return_VALUE(0); return 0;
} }
static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
{ {
int result; int result;
ACPI_FUNCTION_TRACE("acpi_memory_enable_device");
/* Get the range from the _CRS */ /* Get the range from the _CRS */
result = acpi_memory_get_device_resources(mem_device); result = acpi_memory_get_device_resources(mem_device);
...@@ -213,7 +209,6 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) ...@@ -213,7 +209,6 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
union acpi_object arg; union acpi_object arg;
unsigned long current_status; unsigned long current_status;
ACPI_FUNCTION_TRACE("acpi_memory_powerdown_device");
/* Issue the _EJ0 command */ /* Issue the _EJ0 command */
arg_list.count = 1; arg_list.count = 1;
...@@ -225,20 +220,20 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) ...@@ -225,20 +220,20 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
/* Return on _EJ0 failure */ /* Return on _EJ0 failure */
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "_EJ0 failed")); ACPI_EXCEPTION((AE_INFO, status, "_EJ0 failed"));
return_VALUE(-ENODEV); return -ENODEV;
} }
/* Evalute _STA to check if the device is disabled */ /* Evalute _STA to check if the device is disabled */
status = acpi_evaluate_integer(mem_device->handle, "_STA", status = acpi_evaluate_integer(mem_device->handle, "_STA",
NULL, &current_status); NULL, &current_status);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return_VALUE(-ENODEV); return -ENODEV;
/* Check for device status. Device should be disabled */ /* Check for device status. Device should be disabled */
if (current_status & ACPI_MEMORY_STA_ENABLED) if (current_status & ACPI_MEMORY_STA_ENABLED)
return_VALUE(-EINVAL); return -EINVAL;
return_VALUE(0); return 0;
} }
static int acpi_memory_disable_device(struct acpi_memory_device *mem_device) static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
...@@ -247,7 +242,6 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device) ...@@ -247,7 +242,6 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
u64 start = mem_device->start_addr; u64 start = mem_device->start_addr;
u64 len = mem_device->length; u64 len = mem_device->length;
ACPI_FUNCTION_TRACE("acpi_memory_disable_device");
/* /*
* Ask the VM to offline this memory range. * Ask the VM to offline this memory range.
...@@ -255,7 +249,7 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device) ...@@ -255,7 +249,7 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
*/ */
result = remove_memory(start, len); result = remove_memory(start, len);
if (result) if (result)
return_VALUE(result); return result;
/* Power-off and eject the device */ /* Power-off and eject the device */
result = acpi_memory_powerdown_device(mem_device); result = acpi_memory_powerdown_device(mem_device);
...@@ -274,7 +268,6 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) ...@@ -274,7 +268,6 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
struct acpi_memory_device *mem_device; struct acpi_memory_device *mem_device;
struct acpi_device *device; struct acpi_device *device;
ACPI_FUNCTION_TRACE("acpi_memory_device_notify");
switch (event) { switch (event) {
case ACPI_NOTIFY_BUS_CHECK: case ACPI_NOTIFY_BUS_CHECK:
...@@ -287,7 +280,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) ...@@ -287,7 +280,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
"\nReceived DEVICE CHECK notification for device\n")); "\nReceived DEVICE CHECK notification for device\n"));
if (acpi_memory_get_device(handle, &mem_device)) { if (acpi_memory_get_device(handle, &mem_device)) {
printk(KERN_ERR PREFIX "Cannot find driver data\n"); printk(KERN_ERR PREFIX "Cannot find driver data\n");
return_VOID; return;
} }
if (!acpi_memory_check_device(mem_device)) { if (!acpi_memory_check_device(mem_device)) {
...@@ -329,7 +322,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) ...@@ -329,7 +322,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
break; break;
} }
return_VOID; return;
} }
static int acpi_memory_device_add(struct acpi_device *device) static int acpi_memory_device_add(struct acpi_device *device)
...@@ -337,14 +330,13 @@ static int acpi_memory_device_add(struct acpi_device *device) ...@@ -337,14 +330,13 @@ static int acpi_memory_device_add(struct acpi_device *device)
int result; int result;
struct acpi_memory_device *mem_device = NULL; struct acpi_memory_device *mem_device = NULL;
ACPI_FUNCTION_TRACE("acpi_memory_device_add");
if (!device) if (!device)
return_VALUE(-EINVAL); return -EINVAL;
mem_device = kmalloc(sizeof(struct acpi_memory_device), GFP_KERNEL); mem_device = kmalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
if (!mem_device) if (!mem_device)
return_VALUE(-ENOMEM); return -ENOMEM;
memset(mem_device, 0, sizeof(struct acpi_memory_device)); memset(mem_device, 0, sizeof(struct acpi_memory_device));
mem_device->handle = device->handle; mem_device->handle = device->handle;
...@@ -356,7 +348,7 @@ static int acpi_memory_device_add(struct acpi_device *device) ...@@ -356,7 +348,7 @@ static int acpi_memory_device_add(struct acpi_device *device)
result = acpi_memory_get_device_resources(mem_device); result = acpi_memory_get_device_resources(mem_device);
if (result) { if (result) {
kfree(mem_device); kfree(mem_device);
return_VALUE(result); return result;
} }
/* Set the device state */ /* Set the device state */
...@@ -364,22 +356,21 @@ static int acpi_memory_device_add(struct acpi_device *device) ...@@ -364,22 +356,21 @@ static int acpi_memory_device_add(struct acpi_device *device)
printk(KERN_INFO "%s \n", acpi_device_name(device)); printk(KERN_INFO "%s \n", acpi_device_name(device));
return_VALUE(result); return result;
} }
static int acpi_memory_device_remove(struct acpi_device *device, int type) static int acpi_memory_device_remove(struct acpi_device *device, int type)
{ {
struct acpi_memory_device *mem_device = NULL; struct acpi_memory_device *mem_device = NULL;
ACPI_FUNCTION_TRACE("acpi_memory_device_remove");
if (!device || !acpi_driver_data(device)) if (!device || !acpi_driver_data(device))
return_VALUE(-EINVAL); return -EINVAL;
mem_device = (struct acpi_memory_device *)acpi_driver_data(device); mem_device = (struct acpi_memory_device *)acpi_driver_data(device);
kfree(mem_device); kfree(mem_device);
return_VALUE(0); return 0;
} }
/* /*
...@@ -392,16 +383,15 @@ static acpi_status is_memory_device(acpi_handle handle) ...@@ -392,16 +383,15 @@ static acpi_status is_memory_device(acpi_handle handle)
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_device_info *info; struct acpi_device_info *info;
ACPI_FUNCTION_TRACE("is_memory_device");
status = acpi_get_object_info(handle, &buffer); status = acpi_get_object_info(handle, &buffer);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return_ACPI_STATUS(status); return status;
info = buffer.pointer; info = buffer.pointer;
if (!(info->valid & ACPI_VALID_HID)) { if (!(info->valid & ACPI_VALID_HID)) {
acpi_os_free(buffer.pointer); acpi_os_free(buffer.pointer);
return_ACPI_STATUS(AE_ERROR); return AE_ERROR;
} }
hardware_id = info->hardware_id.value; hardware_id = info->hardware_id.value;
...@@ -410,7 +400,7 @@ static acpi_status is_memory_device(acpi_handle handle) ...@@ -410,7 +400,7 @@ static acpi_status is_memory_device(acpi_handle handle)
status = AE_ERROR; status = AE_ERROR;
acpi_os_free(buffer.pointer); acpi_os_free(buffer.pointer);
return_ACPI_STATUS(status); return status;
} }
static acpi_status static acpi_status
...@@ -419,18 +409,17 @@ acpi_memory_register_notify_handler(acpi_handle handle, ...@@ -419,18 +409,17 @@ acpi_memory_register_notify_handler(acpi_handle handle,
{ {
acpi_status status; acpi_status status;
ACPI_FUNCTION_TRACE("acpi_memory_register_notify_handler");
status = is_memory_device(handle); status = is_memory_device(handle);
if (ACPI_FAILURE(status)){ if (ACPI_FAILURE(status)){
ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device")); ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
return_ACPI_STATUS(AE_OK); /* continue */ return AE_OK; /* continue */
} }
status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
acpi_memory_device_notify, NULL); acpi_memory_device_notify, NULL);
/* continue */ /* continue */
return_ACPI_STATUS(AE_OK); return AE_OK;
} }
static acpi_status static acpi_status
...@@ -439,19 +428,18 @@ acpi_memory_deregister_notify_handler(acpi_handle handle, ...@@ -439,19 +428,18 @@ acpi_memory_deregister_notify_handler(acpi_handle handle,
{ {
acpi_status status; acpi_status status;
ACPI_FUNCTION_TRACE("acpi_memory_deregister_notify_handler");
status = is_memory_device(handle); status = is_memory_device(handle);
if (ACPI_FAILURE(status)){ if (ACPI_FAILURE(status)){
ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device")); ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
return_ACPI_STATUS(AE_OK); /* continue */ return AE_OK; /* continue */
} }
status = acpi_remove_notify_handler(handle, status = acpi_remove_notify_handler(handle,
ACPI_SYSTEM_NOTIFY, ACPI_SYSTEM_NOTIFY,
acpi_memory_device_notify); acpi_memory_device_notify);
return_ACPI_STATUS(AE_OK); /* continue */ return AE_OK; /* continue */
} }
static int __init acpi_memory_device_init(void) static int __init acpi_memory_device_init(void)
...@@ -459,12 +447,11 @@ static int __init acpi_memory_device_init(void) ...@@ -459,12 +447,11 @@ static int __init acpi_memory_device_init(void)
int result; int result;
acpi_status status; acpi_status status;
ACPI_FUNCTION_TRACE("acpi_memory_device_init");
result = acpi_bus_register_driver(&acpi_memory_device_driver); result = acpi_bus_register_driver(&acpi_memory_device_driver);
if (result < 0) if (result < 0)
return_VALUE(-ENODEV); return -ENODEV;
status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, ACPI_UINT32_MAX,
...@@ -474,17 +461,16 @@ static int __init acpi_memory_device_init(void) ...@@ -474,17 +461,16 @@ static int __init acpi_memory_device_init(void)
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "walk_namespace failed")); ACPI_EXCEPTION((AE_INFO, status, "walk_namespace failed"));
acpi_bus_unregister_driver(&acpi_memory_device_driver); acpi_bus_unregister_driver(&acpi_memory_device_driver);
return_VALUE(-ENODEV); return -ENODEV;
} }
return_VALUE(0); return 0;
} }
static void __exit acpi_memory_device_exit(void) static void __exit acpi_memory_device_exit(void)
{ {
acpi_status status; acpi_status status;
ACPI_FUNCTION_TRACE("acpi_memory_device_exit");
/* /*
* Adding this to un-install notification handlers for all the device * Adding this to un-install notification handlers for all the device
...@@ -500,7 +486,7 @@ static void __exit acpi_memory_device_exit(void) ...@@ -500,7 +486,7 @@ static void __exit acpi_memory_device_exit(void)
acpi_bus_unregister_driver(&acpi_memory_device_driver); acpi_bus_unregister_driver(&acpi_memory_device_driver);
return_VOID; return;
} }
module_init(acpi_memory_device_init); module_init(acpi_memory_device_init);
......
...@@ -132,17 +132,16 @@ acpi_battery_get_info(struct acpi_battery *battery, ...@@ -132,17 +132,16 @@ acpi_battery_get_info(struct acpi_battery *battery,
struct acpi_buffer data = { 0, NULL }; struct acpi_buffer data = { 0, NULL };
union acpi_object *package = NULL; union acpi_object *package = NULL;
ACPI_FUNCTION_TRACE("acpi_battery_get_info");
if (!battery || !bif) if (!battery || !bif)
return_VALUE(-EINVAL); return -EINVAL;
/* Evalute _BIF */ /* Evalute _BIF */
status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer); status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF")); ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF"));
return_VALUE(-ENODEV); return -ENODEV;
} }
package = (union acpi_object *)buffer.pointer; package = (union acpi_object *)buffer.pointer;
...@@ -177,7 +176,7 @@ acpi_battery_get_info(struct acpi_battery *battery, ...@@ -177,7 +176,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
if (!result) if (!result)
(*bif) = (struct acpi_battery_info *)data.pointer; (*bif) = (struct acpi_battery_info *)data.pointer;
return_VALUE(result); return result;
} }
static int static int
...@@ -193,17 +192,16 @@ acpi_battery_get_status(struct acpi_battery *battery, ...@@ -193,17 +192,16 @@ acpi_battery_get_status(struct acpi_battery *battery,
struct acpi_buffer data = { 0, NULL }; struct acpi_buffer data = { 0, NULL };
union acpi_object *package = NULL; union acpi_object *package = NULL;
ACPI_FUNCTION_TRACE("acpi_battery_get_status");
if (!battery || !bst) if (!battery || !bst)
return_VALUE(-EINVAL); return -EINVAL;
/* Evalute _BST */ /* Evalute _BST */
status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer); status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST")); ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST"));
return_VALUE(-ENODEV); return -ENODEV;
} }
package = (union acpi_object *)buffer.pointer; package = (union acpi_object *)buffer.pointer;
...@@ -238,7 +236,7 @@ acpi_battery_get_status(struct acpi_battery *battery, ...@@ -238,7 +236,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
if (!result) if (!result)
(*bst) = (struct acpi_battery_status *)data.pointer; (*bst) = (struct acpi_battery_status *)data.pointer;
return_VALUE(result); return result;
} }
static int static int
...@@ -248,25 +246,24 @@ acpi_battery_set_alarm(struct acpi_battery *battery, unsigned long alarm) ...@@ -248,25 +246,24 @@ acpi_battery_set_alarm(struct acpi_battery *battery, unsigned long alarm)
union acpi_object arg0 = { ACPI_TYPE_INTEGER }; union acpi_object arg0 = { ACPI_TYPE_INTEGER };
struct acpi_object_list arg_list = { 1, &arg0 }; struct acpi_object_list arg_list = { 1, &arg0 };
ACPI_FUNCTION_TRACE("acpi_battery_set_alarm");
if (!battery) if (!battery)
return_VALUE(-EINVAL); return -EINVAL;
if (!battery->flags.alarm) if (!battery->flags.alarm)
return_VALUE(-ENODEV); return -ENODEV;
arg0.integer.value = alarm; arg0.integer.value = alarm;
status = acpi_evaluate_object(battery->handle, "_BTP", &arg_list, NULL); status = acpi_evaluate_object(battery->handle, "_BTP", &arg_list, NULL);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return_VALUE(-ENODEV); return -ENODEV;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Alarm set to %d\n", (u32) alarm)); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Alarm set to %d\n", (u32) alarm));
battery->alarm = alarm; battery->alarm = alarm;
return_VALUE(0); return 0;
} }
static int acpi_battery_check(struct acpi_battery *battery) static int acpi_battery_check(struct acpi_battery *battery)
...@@ -277,18 +274,17 @@ static int acpi_battery_check(struct acpi_battery *battery) ...@@ -277,18 +274,17 @@ static int acpi_battery_check(struct acpi_battery *battery)
struct acpi_device *device = NULL; struct acpi_device *device = NULL;
struct acpi_battery_info *bif = NULL; struct acpi_battery_info *bif = NULL;
ACPI_FUNCTION_TRACE("acpi_battery_check");
if (!battery) if (!battery)
return_VALUE(-EINVAL); return -EINVAL;
result = acpi_bus_get_device(battery->handle, &device); result = acpi_bus_get_device(battery->handle, &device);
if (result) if (result)
return_VALUE(result); return result;
result = acpi_bus_get_status(device); result = acpi_bus_get_status(device);
if (result) if (result)
return_VALUE(result); return result;
/* Insertion? */ /* Insertion? */
...@@ -300,7 +296,7 @@ static int acpi_battery_check(struct acpi_battery *battery) ...@@ -300,7 +296,7 @@ static int acpi_battery_check(struct acpi_battery *battery)
result = acpi_battery_get_info(battery, &bif); result = acpi_battery_get_info(battery, &bif);
if (result) if (result)
return_VALUE(result); return result;
battery->flags.power_unit = bif->power_unit; battery->flags.power_unit = bif->power_unit;
battery->trips.warning = bif->design_capacity_warning; battery->trips.warning = bif->design_capacity_warning;
...@@ -324,7 +320,7 @@ static int acpi_battery_check(struct acpi_battery *battery) ...@@ -324,7 +320,7 @@ static int acpi_battery_check(struct acpi_battery *battery)
battery->flags.present = device->status.battery_present; battery->flags.present = device->status.battery_present;
return_VALUE(result); return result;
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
...@@ -339,7 +335,6 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset) ...@@ -339,7 +335,6 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset)
struct acpi_battery_info *bif = NULL; struct acpi_battery_info *bif = NULL;
char *units = "?"; char *units = "?";
ACPI_FUNCTION_TRACE("acpi_battery_read_info");
if (!battery) if (!battery)
goto end; goto end;
...@@ -409,7 +404,7 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset) ...@@ -409,7 +404,7 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset)
end: end:
kfree(bif); kfree(bif);
return_VALUE(0); return 0;
} }
static int acpi_battery_info_open_fs(struct inode *inode, struct file *file) static int acpi_battery_info_open_fs(struct inode *inode, struct file *file)
...@@ -424,7 +419,6 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset) ...@@ -424,7 +419,6 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
struct acpi_battery_status *bst = NULL; struct acpi_battery_status *bst = NULL;
char *units = "?"; char *units = "?";
ACPI_FUNCTION_TRACE("acpi_battery_read_state");
if (!battery) if (!battery)
goto end; goto end;
...@@ -487,7 +481,7 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset) ...@@ -487,7 +481,7 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
end: end:
kfree(bst); kfree(bst);
return_VALUE(0); return 0;
} }
static int acpi_battery_state_open_fs(struct inode *inode, struct file *file) static int acpi_battery_state_open_fs(struct inode *inode, struct file *file)
...@@ -500,7 +494,6 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) ...@@ -500,7 +494,6 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)
struct acpi_battery *battery = (struct acpi_battery *)seq->private; struct acpi_battery *battery = (struct acpi_battery *)seq->private;
char *units = "?"; char *units = "?";
ACPI_FUNCTION_TRACE("acpi_battery_read_alarm");
if (!battery) if (!battery)
goto end; goto end;
...@@ -525,7 +518,7 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) ...@@ -525,7 +518,7 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)
seq_printf(seq, "%d %sh\n", (u32) battery->alarm, units); seq_printf(seq, "%d %sh\n", (u32) battery->alarm, units);
end: end:
return_VALUE(0); return 0;
} }
static ssize_t static ssize_t
...@@ -538,25 +531,24 @@ acpi_battery_write_alarm(struct file *file, ...@@ -538,25 +531,24 @@ acpi_battery_write_alarm(struct file *file,
struct seq_file *m = (struct seq_file *)file->private_data; struct seq_file *m = (struct seq_file *)file->private_data;
struct acpi_battery *battery = (struct acpi_battery *)m->private; struct acpi_battery *battery = (struct acpi_battery *)m->private;
ACPI_FUNCTION_TRACE("acpi_battery_write_alarm");
if (!battery || (count > sizeof(alarm_string) - 1)) if (!battery || (count > sizeof(alarm_string) - 1))
return_VALUE(-EINVAL); return -EINVAL;
if (!battery->flags.present) if (!battery->flags.present)
return_VALUE(-ENODEV); return -ENODEV;
if (copy_from_user(alarm_string, buffer, count)) if (copy_from_user(alarm_string, buffer, count))
return_VALUE(-EFAULT); return -EFAULT;
alarm_string[count] = '\0'; alarm_string[count] = '\0';
result = acpi_battery_set_alarm(battery, result = acpi_battery_set_alarm(battery,
simple_strtoul(alarm_string, NULL, 0)); simple_strtoul(alarm_string, NULL, 0));
if (result) if (result)
return_VALUE(result); return result;
return_VALUE(count); return count;
} }
static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file) static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file)
...@@ -593,13 +585,12 @@ static int acpi_battery_add_fs(struct acpi_device *device) ...@@ -593,13 +585,12 @@ static int acpi_battery_add_fs(struct acpi_device *device)
{ {
struct proc_dir_entry *entry = NULL; struct proc_dir_entry *entry = NULL;
ACPI_FUNCTION_TRACE("acpi_battery_add_fs");
if (!acpi_device_dir(device)) { if (!acpi_device_dir(device)) {
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
acpi_battery_dir); acpi_battery_dir);
if (!acpi_device_dir(device)) if (!acpi_device_dir(device))
return_VALUE(-ENODEV); return -ENODEV;
acpi_device_dir(device)->owner = THIS_MODULE; acpi_device_dir(device)->owner = THIS_MODULE;
} }
...@@ -607,7 +598,7 @@ static int acpi_battery_add_fs(struct acpi_device *device) ...@@ -607,7 +598,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
entry = create_proc_entry(ACPI_BATTERY_FILE_INFO, entry = create_proc_entry(ACPI_BATTERY_FILE_INFO,
S_IRUGO, acpi_device_dir(device)); S_IRUGO, acpi_device_dir(device));
if (!entry) if (!entry)
return_VALUE(-ENODEV); return -ENODEV;
else { else {
entry->proc_fops = &acpi_battery_info_ops; entry->proc_fops = &acpi_battery_info_ops;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
...@@ -618,7 +609,7 @@ static int acpi_battery_add_fs(struct acpi_device *device) ...@@ -618,7 +609,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS, entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS,
S_IRUGO, acpi_device_dir(device)); S_IRUGO, acpi_device_dir(device));
if (!entry) if (!entry)
return_VALUE(-ENODEV); return -ENODEV;
else { else {
entry->proc_fops = &acpi_battery_state_ops; entry->proc_fops = &acpi_battery_state_ops;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
...@@ -630,19 +621,18 @@ static int acpi_battery_add_fs(struct acpi_device *device) ...@@ -630,19 +621,18 @@ static int acpi_battery_add_fs(struct acpi_device *device)
S_IFREG | S_IRUGO | S_IWUSR, S_IFREG | S_IRUGO | S_IWUSR,
acpi_device_dir(device)); acpi_device_dir(device));
if (!entry) if (!entry)
return_VALUE(-ENODEV); return -ENODEV;
else { else {
entry->proc_fops = &acpi_battery_alarm_ops; entry->proc_fops = &acpi_battery_alarm_ops;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
entry->owner = THIS_MODULE; entry->owner = THIS_MODULE;
} }
return_VALUE(0); return 0;
} }
static int acpi_battery_remove_fs(struct acpi_device *device) static int acpi_battery_remove_fs(struct acpi_device *device)
{ {
ACPI_FUNCTION_TRACE("acpi_battery_remove_fs");
if (acpi_device_dir(device)) { if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_BATTERY_FILE_ALARM, remove_proc_entry(ACPI_BATTERY_FILE_ALARM,
...@@ -656,7 +646,7 @@ static int acpi_battery_remove_fs(struct acpi_device *device) ...@@ -656,7 +646,7 @@ static int acpi_battery_remove_fs(struct acpi_device *device)
acpi_device_dir(device) = NULL; acpi_device_dir(device) = NULL;
} }
return_VALUE(0); return 0;
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
...@@ -668,13 +658,12 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data) ...@@ -668,13 +658,12 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
struct acpi_battery *battery = (struct acpi_battery *)data; struct acpi_battery *battery = (struct acpi_battery *)data;
struct acpi_device *device = NULL; struct acpi_device *device = NULL;
ACPI_FUNCTION_TRACE("acpi_battery_notify");
if (!battery) if (!battery)
return_VOID; return;
if (acpi_bus_get_device(handle, &device)) if (acpi_bus_get_device(handle, &device))
return_VOID; return;
switch (event) { switch (event) {
case ACPI_BATTERY_NOTIFY_STATUS: case ACPI_BATTERY_NOTIFY_STATUS:
...@@ -688,7 +677,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data) ...@@ -688,7 +677,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
break; break;
} }
return_VOID; return;
} }
static int acpi_battery_add(struct acpi_device *device) static int acpi_battery_add(struct acpi_device *device)
...@@ -697,14 +686,13 @@ static int acpi_battery_add(struct acpi_device *device) ...@@ -697,14 +686,13 @@ static int acpi_battery_add(struct acpi_device *device)
acpi_status status = 0; acpi_status status = 0;
struct acpi_battery *battery = NULL; struct acpi_battery *battery = NULL;
ACPI_FUNCTION_TRACE("acpi_battery_add");
if (!device) if (!device)
return_VALUE(-EINVAL); return -EINVAL;
battery = kmalloc(sizeof(struct acpi_battery), GFP_KERNEL); battery = kmalloc(sizeof(struct acpi_battery), GFP_KERNEL);
if (!battery) if (!battery)
return_VALUE(-ENOMEM); return -ENOMEM;
memset(battery, 0, sizeof(struct acpi_battery)); memset(battery, 0, sizeof(struct acpi_battery));
battery->handle = device->handle; battery->handle = device->handle;
...@@ -738,7 +726,7 @@ static int acpi_battery_add(struct acpi_device *device) ...@@ -738,7 +726,7 @@ static int acpi_battery_add(struct acpi_device *device)
kfree(battery); kfree(battery);
} }
return_VALUE(result); return result;
} }
static int acpi_battery_remove(struct acpi_device *device, int type) static int acpi_battery_remove(struct acpi_device *device, int type)
...@@ -746,10 +734,9 @@ static int acpi_battery_remove(struct acpi_device *device, int type) ...@@ -746,10 +734,9 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
acpi_status status = 0; acpi_status status = 0;
struct acpi_battery *battery = NULL; struct acpi_battery *battery = NULL;
ACPI_FUNCTION_TRACE("acpi_battery_remove");
if (!device || !acpi_driver_data(device)) if (!device || !acpi_driver_data(device))
return_VALUE(-EINVAL); return -EINVAL;
battery = (struct acpi_battery *)acpi_driver_data(device); battery = (struct acpi_battery *)acpi_driver_data(device);
...@@ -761,38 +748,36 @@ static int acpi_battery_remove(struct acpi_device *device, int type) ...@@ -761,38 +748,36 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
kfree(battery); kfree(battery);
return_VALUE(0); return 0;
} }
static int __init acpi_battery_init(void) static int __init acpi_battery_init(void)
{ {
int result = 0; int result = 0;
ACPI_FUNCTION_TRACE("acpi_battery_init");
acpi_battery_dir = proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir); acpi_battery_dir = proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir);
if (!acpi_battery_dir) if (!acpi_battery_dir)
return_VALUE(-ENODEV); return -ENODEV;
acpi_battery_dir->owner = THIS_MODULE; acpi_battery_dir->owner = THIS_MODULE;
result = acpi_bus_register_driver(&acpi_battery_driver); result = acpi_bus_register_driver(&acpi_battery_driver);
if (result < 0) { if (result < 0) {
remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
return_VALUE(-ENODEV); return -ENODEV;
} }
return_VALUE(0); return 0;
} }
static void __exit acpi_battery_exit(void) static void __exit acpi_battery_exit(void)
{ {
ACPI_FUNCTION_TRACE("acpi_battery_exit");
acpi_bus_unregister_driver(&acpi_battery_driver); acpi_bus_unregister_driver(&acpi_battery_driver);
remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
return_VOID; return;
} }
module_init(acpi_battery_init); module_init(acpi_battery_init);
......
This diff is collapsed.
...@@ -112,15 +112,14 @@ static int acpi_button_info_seq_show(struct seq_file *seq, void *offset) ...@@ -112,15 +112,14 @@ static int acpi_button_info_seq_show(struct seq_file *seq, void *offset)
{ {
struct acpi_button *button = (struct acpi_button *)seq->private; struct acpi_button *button = (struct acpi_button *)seq->private;
ACPI_FUNCTION_TRACE("acpi_button_info_seq_show");
if (!button || !button->device) if (!button || !button->device)
return_VALUE(0); return 0;
seq_printf(seq, "type: %s\n", seq_printf(seq, "type: %s\n",
acpi_device_name(button->device)); acpi_device_name(button->device));
return_VALUE(0); return 0;
} }
static int acpi_button_info_open_fs(struct inode *inode, struct file *file) static int acpi_button_info_open_fs(struct inode *inode, struct file *file)
...@@ -134,10 +133,9 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) ...@@ -134,10 +133,9 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
acpi_status status; acpi_status status;
unsigned long state; unsigned long state;
ACPI_FUNCTION_TRACE("acpi_button_state_seq_show");
if (!button || !button->device) if (!button || !button->device)
return_VALUE(0); return 0;
status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state); status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
...@@ -147,7 +145,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) ...@@ -147,7 +145,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
(state ? "open" : "closed")); (state ? "open" : "closed"));
} }
return_VALUE(0); return 0;
} }
static int acpi_button_state_open_fs(struct inode *inode, struct file *file) static int acpi_button_state_open_fs(struct inode *inode, struct file *file)
...@@ -164,10 +162,9 @@ static int acpi_button_add_fs(struct acpi_device *device) ...@@ -164,10 +162,9 @@ static int acpi_button_add_fs(struct acpi_device *device)
struct proc_dir_entry *entry = NULL; struct proc_dir_entry *entry = NULL;
struct acpi_button *button = NULL; struct acpi_button *button = NULL;
ACPI_FUNCTION_TRACE("acpi_button_add_fs");
if (!device || !acpi_driver_data(device)) if (!device || !acpi_driver_data(device))
return_VALUE(-EINVAL); return -EINVAL;
button = acpi_driver_data(device); button = acpi_driver_data(device);
...@@ -195,19 +192,19 @@ static int acpi_button_add_fs(struct acpi_device *device) ...@@ -195,19 +192,19 @@ static int acpi_button_add_fs(struct acpi_device *device)
} }
if (!entry) if (!entry)
return_VALUE(-ENODEV); return -ENODEV;
entry->owner = THIS_MODULE; entry->owner = THIS_MODULE;
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry); acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry);
if (!acpi_device_dir(device)) if (!acpi_device_dir(device))
return_VALUE(-ENODEV); return -ENODEV;
acpi_device_dir(device)->owner = THIS_MODULE; acpi_device_dir(device)->owner = THIS_MODULE;
/* 'info' [R] */ /* 'info' [R] */
entry = create_proc_entry(ACPI_BUTTON_FILE_INFO, entry = create_proc_entry(ACPI_BUTTON_FILE_INFO,
S_IRUGO, acpi_device_dir(device)); S_IRUGO, acpi_device_dir(device));
if (!entry) if (!entry)
return_VALUE(-ENODEV); return -ENODEV;
else { else {
entry->proc_fops = &acpi_button_info_fops; entry->proc_fops = &acpi_button_info_fops;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
...@@ -227,14 +224,13 @@ static int acpi_button_add_fs(struct acpi_device *device) ...@@ -227,14 +224,13 @@ static int acpi_button_add_fs(struct acpi_device *device)
} }
} }
return_VALUE(0); return 0;
} }
static int acpi_button_remove_fs(struct acpi_device *device) static int acpi_button_remove_fs(struct acpi_device *device)
{ {
struct acpi_button *button = NULL; struct acpi_button *button = NULL;
ACPI_FUNCTION_TRACE("acpi_button_remove_fs");
button = acpi_driver_data(device); button = acpi_driver_data(device);
if (acpi_device_dir(device)) { if (acpi_device_dir(device)) {
...@@ -249,7 +245,7 @@ static int acpi_button_remove_fs(struct acpi_device *device) ...@@ -249,7 +245,7 @@ static int acpi_button_remove_fs(struct acpi_device *device)
acpi_device_dir(device) = NULL; acpi_device_dir(device) = NULL;
} }
return_VALUE(0); return 0;
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
...@@ -260,10 +256,9 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data) ...@@ -260,10 +256,9 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
{ {
struct acpi_button *button = (struct acpi_button *)data; struct acpi_button *button = (struct acpi_button *)data;
ACPI_FUNCTION_TRACE("acpi_button_notify");
if (!button || !button->device) if (!button || !button->device)
return_VOID; return;
switch (event) { switch (event) {
case ACPI_BUTTON_NOTIFY_STATUS: case ACPI_BUTTON_NOTIFY_STATUS:
...@@ -276,21 +271,20 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data) ...@@ -276,21 +271,20 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
break; break;
} }
return_VOID; return;
} }
static acpi_status acpi_button_notify_fixed(void *data) static acpi_status acpi_button_notify_fixed(void *data)
{ {
struct acpi_button *button = (struct acpi_button *)data; struct acpi_button *button = (struct acpi_button *)data;
ACPI_FUNCTION_TRACE("acpi_button_notify_fixed");
if (!button) if (!button)
return_ACPI_STATUS(AE_BAD_PARAMETER); return AE_BAD_PARAMETER;
acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button); acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button);
return_ACPI_STATUS(AE_OK); return AE_OK;
} }
static int acpi_button_add(struct acpi_device *device) static int acpi_button_add(struct acpi_device *device)
...@@ -299,14 +293,13 @@ static int acpi_button_add(struct acpi_device *device) ...@@ -299,14 +293,13 @@ static int acpi_button_add(struct acpi_device *device)
acpi_status status = AE_OK; acpi_status status = AE_OK;
struct acpi_button *button = NULL; struct acpi_button *button = NULL;
ACPI_FUNCTION_TRACE("acpi_button_add");
if (!device) if (!device)
return_VALUE(-EINVAL); return -EINVAL;
button = kmalloc(sizeof(struct acpi_button), GFP_KERNEL); button = kmalloc(sizeof(struct acpi_button), GFP_KERNEL);
if (!button) if (!button)
return_VALUE(-ENOMEM); return -ENOMEM;
memset(button, 0, sizeof(struct acpi_button)); memset(button, 0, sizeof(struct acpi_button));
button->device = device; button->device = device;
...@@ -400,7 +393,7 @@ static int acpi_button_add(struct acpi_device *device) ...@@ -400,7 +393,7 @@ static int acpi_button_add(struct acpi_device *device)
kfree(button); kfree(button);
} }
return_VALUE(result); return result;
} }
static int acpi_button_remove(struct acpi_device *device, int type) static int acpi_button_remove(struct acpi_device *device, int type)
...@@ -408,10 +401,9 @@ static int acpi_button_remove(struct acpi_device *device, int type) ...@@ -408,10 +401,9 @@ static int acpi_button_remove(struct acpi_device *device, int type)
acpi_status status = 0; acpi_status status = 0;
struct acpi_button *button = NULL; struct acpi_button *button = NULL;
ACPI_FUNCTION_TRACE("acpi_button_remove");
if (!device || !acpi_driver_data(device)) if (!device || !acpi_driver_data(device))
return_VALUE(-EINVAL); return -EINVAL;
button = acpi_driver_data(device); button = acpi_driver_data(device);
...@@ -438,31 +430,29 @@ static int acpi_button_remove(struct acpi_device *device, int type) ...@@ -438,31 +430,29 @@ static int acpi_button_remove(struct acpi_device *device, int type)
kfree(button); kfree(button);
return_VALUE(0); return 0;
} }
static int __init acpi_button_init(void) static int __init acpi_button_init(void)
{ {
int result = 0; int result = 0;
ACPI_FUNCTION_TRACE("acpi_button_init");
acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir); acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir);
if (!acpi_button_dir) if (!acpi_button_dir)
return_VALUE(-ENODEV); return -ENODEV;
acpi_button_dir->owner = THIS_MODULE; acpi_button_dir->owner = THIS_MODULE;
result = acpi_bus_register_driver(&acpi_button_driver); result = acpi_bus_register_driver(&acpi_button_driver);
if (result < 0) { if (result < 0) {
remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir); remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
return_VALUE(-ENODEV); return -ENODEV;
} }
return_VALUE(0); return 0;
} }
static void __exit acpi_button_exit(void) static void __exit acpi_button_exit(void)
{ {
ACPI_FUNCTION_TRACE("acpi_button_exit");
acpi_bus_unregister_driver(&acpi_button_driver); acpi_bus_unregister_driver(&acpi_button_driver);
...@@ -474,7 +464,7 @@ static void __exit acpi_button_exit(void) ...@@ -474,7 +464,7 @@ static void __exit acpi_button_exit(void)
remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, acpi_button_dir); remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, acpi_button_dir);
remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir); remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
return_VOID; return;
} }
module_init(acpi_button_init); module_init(acpi_button_init);
......
...@@ -73,17 +73,16 @@ static int is_device_present(acpi_handle handle) ...@@ -73,17 +73,16 @@ static int is_device_present(acpi_handle handle)
acpi_status status; acpi_status status;
unsigned long sta; unsigned long sta;
ACPI_FUNCTION_TRACE("is_device_present");
status = acpi_get_handle(handle, "_STA", &temp); status = acpi_get_handle(handle, "_STA", &temp);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return_VALUE(1); /* _STA not found, assmue device present */ return 1; /* _STA not found, assmue device present */
status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return_VALUE(0); /* Firmware error */ return 0; /* Firmware error */
return_VALUE((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT); return ((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT);
} }
/*******************************************************************/ /*******************************************************************/
...@@ -91,16 +90,15 @@ static int acpi_container_add(struct acpi_device *device) ...@@ -91,16 +90,15 @@ static int acpi_container_add(struct acpi_device *device)
{ {
struct acpi_container *container; struct acpi_container *container;
ACPI_FUNCTION_TRACE("acpi_container_add");
if (!device) { if (!device) {
printk(KERN_ERR PREFIX "device is NULL\n"); printk(KERN_ERR PREFIX "device is NULL\n");
return_VALUE(-EINVAL); return -EINVAL;
} }
container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL); container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL);
if (!container) if (!container)
return_VALUE(-ENOMEM); return -ENOMEM;
memset(container, 0, sizeof(struct acpi_container)); memset(container, 0, sizeof(struct acpi_container));
container->handle = device->handle; container->handle = device->handle;
...@@ -111,7 +109,7 @@ static int acpi_container_add(struct acpi_device *device) ...@@ -111,7 +109,7 @@ static int acpi_container_add(struct acpi_device *device)
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n", ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n",
acpi_device_name(device), acpi_device_bid(device))); acpi_device_name(device), acpi_device_bid(device)));
return_VALUE(0); return 0;
} }
static int acpi_container_remove(struct acpi_device *device, int type) static int acpi_container_remove(struct acpi_device *device, int type)
...@@ -130,23 +128,22 @@ static int container_device_add(struct acpi_device **device, acpi_handle handle) ...@@ -130,23 +128,22 @@ static int container_device_add(struct acpi_device **device, acpi_handle handle)
struct acpi_device *pdev; struct acpi_device *pdev;
int result; int result;
ACPI_FUNCTION_TRACE("container_device_add");
if (acpi_get_parent(handle, &phandle)) { if (acpi_get_parent(handle, &phandle)) {
return_VALUE(-ENODEV); return -ENODEV;
} }
if (acpi_bus_get_device(phandle, &pdev)) { if (acpi_bus_get_device(phandle, &pdev)) {
return_VALUE(-ENODEV); return -ENODEV;
} }
if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) { if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) {
return_VALUE(-ENODEV); return -ENODEV;
} }
result = acpi_bus_start(*device); result = acpi_bus_start(*device);
return_VALUE(result); return result;
} }
static void container_notify_cb(acpi_handle handle, u32 type, void *context) static void container_notify_cb(acpi_handle handle, u32 type, void *context)
...@@ -156,7 +153,6 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) ...@@ -156,7 +153,6 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
int present; int present;
acpi_status status; acpi_status status;
ACPI_FUNCTION_TRACE("container_notify_cb");
present = is_device_present(handle); present = is_device_present(handle);
...@@ -192,7 +188,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) ...@@ -192,7 +188,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
default: default:
break; break;
} }
return_VOID; return;
} }
static acpi_status static acpi_status
...@@ -205,11 +201,10 @@ container_walk_namespace_cb(acpi_handle handle, ...@@ -205,11 +201,10 @@ container_walk_namespace_cb(acpi_handle handle,
acpi_status status; acpi_status status;
int *action = context; int *action = context;
ACPI_FUNCTION_TRACE("container_walk_namespace_cb");
status = acpi_get_object_info(handle, &buffer); status = acpi_get_object_info(handle, &buffer);
if (ACPI_FAILURE(status) || !buffer.pointer) { if (ACPI_FAILURE(status) || !buffer.pointer) {
return_ACPI_STATUS(AE_OK); return AE_OK;
} }
info = buffer.pointer; info = buffer.pointer;
...@@ -243,7 +238,7 @@ container_walk_namespace_cb(acpi_handle handle, ...@@ -243,7 +238,7 @@ container_walk_namespace_cb(acpi_handle handle,
end: end:
acpi_os_free(buffer.pointer); acpi_os_free(buffer.pointer);
return_ACPI_STATUS(AE_OK); return AE_OK;
} }
static int __init acpi_container_init(void) static int __init acpi_container_init(void)
...@@ -269,7 +264,6 @@ static void __exit acpi_container_exit(void) ...@@ -269,7 +264,6 @@ static void __exit acpi_container_exit(void)
{ {
int action = UNINSTALL_NOTIFY_HANDLER; int action = UNINSTALL_NOTIFY_HANDLER;
ACPI_FUNCTION_TRACE("acpi_container_exit");
acpi_walk_namespace(ACPI_TYPE_DEVICE, acpi_walk_namespace(ACPI_TYPE_DEVICE,
ACPI_ROOT_OBJECT, ACPI_ROOT_OBJECT,
...@@ -278,7 +272,7 @@ static void __exit acpi_container_exit(void) ...@@ -278,7 +272,7 @@ static void __exit acpi_container_exit(void)
acpi_bus_unregister_driver(&acpi_container_driver); acpi_bus_unregister_driver(&acpi_container_driver);
return_VOID; return;
} }
module_init(acpi_container_init); module_init(acpi_container_init);
......
...@@ -155,13 +155,12 @@ acpi_system_write_debug(struct file *file, ...@@ -155,13 +155,12 @@ acpi_system_write_debug(struct file *file,
{ {
char debug_string[12] = { '\0' }; char debug_string[12] = { '\0' };
ACPI_FUNCTION_TRACE("acpi_system_write_debug");
if (count > sizeof(debug_string) - 1) if (count > sizeof(debug_string) - 1)
return_VALUE(-EINVAL); return -EINVAL;
if (copy_from_user(debug_string, buffer, count)) if (copy_from_user(debug_string, buffer, count))
return_VALUE(-EFAULT); return -EFAULT;
debug_string[count] = '\0'; debug_string[count] = '\0';
...@@ -173,10 +172,10 @@ acpi_system_write_debug(struct file *file, ...@@ -173,10 +172,10 @@ acpi_system_write_debug(struct file *file,
acpi_dbg_level = simple_strtoul(debug_string, NULL, 0); acpi_dbg_level = simple_strtoul(debug_string, NULL, 0);
break; break;
default: default:
return_VALUE(-EINVAL); return -EINVAL;
} }
return_VALUE(count); return count;
} }
static int __init acpi_debug_init(void) static int __init acpi_debug_init(void)
...@@ -185,10 +184,9 @@ static int __init acpi_debug_init(void) ...@@ -185,10 +184,9 @@ static int __init acpi_debug_init(void)
int error = 0; int error = 0;
char *name; char *name;
ACPI_FUNCTION_TRACE("acpi_debug_init");
if (acpi_disabled) if (acpi_disabled)
return_VALUE(0); return 0;
/* 'debug_layer' [R/W] */ /* 'debug_layer' [R/W] */
name = ACPI_SYSTEM_FILE_DEBUG_LAYER; name = ACPI_SYSTEM_FILE_DEBUG_LAYER;
...@@ -213,7 +211,7 @@ static int __init acpi_debug_init(void) ...@@ -213,7 +211,7 @@ static int __init acpi_debug_init(void)
goto Error; goto Error;
Done: Done:
return_VALUE(error); return error;
Error: Error:
remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL, acpi_root_dir); remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL, acpi_root_dir);
......
This diff is collapsed.
...@@ -48,18 +48,17 @@ acpi_system_read_event(struct file *file, char __user * buffer, size_t count, ...@@ -48,18 +48,17 @@ acpi_system_read_event(struct file *file, char __user * buffer, size_t count,
static int chars_remaining = 0; static int chars_remaining = 0;
static char *ptr; static char *ptr;
ACPI_FUNCTION_TRACE("acpi_system_read_event");
if (!chars_remaining) { if (!chars_remaining) {
memset(&event, 0, sizeof(struct acpi_bus_event)); memset(&event, 0, sizeof(struct acpi_bus_event));
if ((file->f_flags & O_NONBLOCK) if ((file->f_flags & O_NONBLOCK)
&& (list_empty(&acpi_bus_event_list))) && (list_empty(&acpi_bus_event_list)))
return_VALUE(-EAGAIN); return -EAGAIN;
result = acpi_bus_receive_event(&event); result = acpi_bus_receive_event(&event);
if (result) if (result)
return_VALUE(result); return result;
chars_remaining = sprintf(str, "%s %s %08x %08x\n", chars_remaining = sprintf(str, "%s %s %08x %08x\n",
event.device_class ? event. event.device_class ? event.
...@@ -75,13 +74,13 @@ acpi_system_read_event(struct file *file, char __user * buffer, size_t count, ...@@ -75,13 +74,13 @@ acpi_system_read_event(struct file *file, char __user * buffer, size_t count,
} }
if (copy_to_user(buffer, ptr, count)) if (copy_to_user(buffer, ptr, count))
return_VALUE(-EFAULT); return -EFAULT;
*ppos += count; *ppos += count;
chars_remaining -= count; chars_remaining -= count;
ptr += count; ptr += count;
return_VALUE(count); return count;
} }
static int acpi_system_close_event(struct inode *inode, struct file *file) static int acpi_system_close_event(struct inode *inode, struct file *file)
...@@ -112,10 +111,9 @@ static int __init acpi_event_init(void) ...@@ -112,10 +111,9 @@ static int __init acpi_event_init(void)
struct proc_dir_entry *entry; struct proc_dir_entry *entry;
int error = 0; int error = 0;
ACPI_FUNCTION_TRACE("acpi_event_init");
if (acpi_disabled) if (acpi_disabled)
return_VALUE(0); return 0;
/* 'event' [R] */ /* 'event' [R] */
entry = create_proc_entry("event", S_IRUSR, acpi_root_dir); entry = create_proc_entry("event", S_IRUSR, acpi_root_dir);
...@@ -124,7 +122,7 @@ static int __init acpi_event_init(void) ...@@ -124,7 +122,7 @@ static int __init acpi_event_init(void)
else { else {
error = -ENODEV; error = -ENODEV;
} }
return_VALUE(error); return error;
} }
subsys_initcall(acpi_event_init); subsys_initcall(acpi_event_init);
...@@ -78,7 +78,6 @@ static int acpi_fan_read_state(struct seq_file *seq, void *offset) ...@@ -78,7 +78,6 @@ static int 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;
ACPI_FUNCTION_TRACE("acpi_fan_read_state");
if (fan) { if (fan) {
if (acpi_bus_get_power(fan->handle, &state)) if (acpi_bus_get_power(fan->handle, &state))
...@@ -87,7 +86,7 @@ static int acpi_fan_read_state(struct seq_file *seq, void *offset) ...@@ -87,7 +86,7 @@ static int acpi_fan_read_state(struct seq_file *seq, void *offset)
seq_printf(seq, "status: %s\n", seq_printf(seq, "status: %s\n",
!state ? "on" : "off"); !state ? "on" : "off");
} }
return_VALUE(0); return 0;
} }
static int acpi_fan_state_open_fs(struct inode *inode, struct file *file) static int acpi_fan_state_open_fs(struct inode *inode, struct file *file)
...@@ -104,22 +103,21 @@ acpi_fan_write_state(struct file *file, const char __user * buffer, ...@@ -104,22 +103,21 @@ acpi_fan_write_state(struct file *file, const char __user * buffer,
struct acpi_fan *fan = (struct acpi_fan *)m->private; struct acpi_fan *fan = (struct acpi_fan *)m->private;
char state_string[12] = { '\0' }; char state_string[12] = { '\0' };
ACPI_FUNCTION_TRACE("acpi_fan_write_state");
if (!fan || (count > sizeof(state_string) - 1)) if (!fan || (count > sizeof(state_string) - 1))
return_VALUE(-EINVAL); return -EINVAL;
if (copy_from_user(state_string, buffer, count)) if (copy_from_user(state_string, buffer, count))
return_VALUE(-EFAULT); return -EFAULT;
state_string[count] = '\0'; state_string[count] = '\0';
result = acpi_bus_set_power(fan->handle, result = acpi_bus_set_power(fan->handle,
simple_strtoul(state_string, NULL, 0)); simple_strtoul(state_string, NULL, 0));
if (result) if (result)
return_VALUE(result); return result;
return_VALUE(count); return count;
} }
static struct file_operations acpi_fan_state_ops = { static struct file_operations acpi_fan_state_ops = {
...@@ -135,16 +133,15 @@ static int acpi_fan_add_fs(struct acpi_device *device) ...@@ -135,16 +133,15 @@ static int acpi_fan_add_fs(struct acpi_device *device)
{ {
struct proc_dir_entry *entry = NULL; struct proc_dir_entry *entry = NULL;
ACPI_FUNCTION_TRACE("acpi_fan_add_fs");
if (!device) if (!device)
return_VALUE(-EINVAL); return -EINVAL;
if (!acpi_device_dir(device)) { if (!acpi_device_dir(device)) {
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
acpi_fan_dir); acpi_fan_dir);
if (!acpi_device_dir(device)) if (!acpi_device_dir(device))
return_VALUE(-ENODEV); return -ENODEV;
acpi_device_dir(device)->owner = THIS_MODULE; acpi_device_dir(device)->owner = THIS_MODULE;
} }
...@@ -153,19 +150,18 @@ static int acpi_fan_add_fs(struct acpi_device *device) ...@@ -153,19 +150,18 @@ static int acpi_fan_add_fs(struct acpi_device *device)
S_IFREG | S_IRUGO | S_IWUSR, S_IFREG | S_IRUGO | S_IWUSR,
acpi_device_dir(device)); acpi_device_dir(device));
if (!entry) if (!entry)
return_VALUE(-ENODEV); return -ENODEV;
else { else {
entry->proc_fops = &acpi_fan_state_ops; entry->proc_fops = &acpi_fan_state_ops;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
entry->owner = THIS_MODULE; entry->owner = THIS_MODULE;
} }
return_VALUE(0); return 0;
} }
static int acpi_fan_remove_fs(struct acpi_device *device) static int acpi_fan_remove_fs(struct acpi_device *device)
{ {
ACPI_FUNCTION_TRACE("acpi_fan_remove_fs");
if (acpi_device_dir(device)) { if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_FAN_FILE_STATE, acpi_device_dir(device)); remove_proc_entry(ACPI_FAN_FILE_STATE, acpi_device_dir(device));
...@@ -173,7 +169,7 @@ static int acpi_fan_remove_fs(struct acpi_device *device) ...@@ -173,7 +169,7 @@ static int acpi_fan_remove_fs(struct acpi_device *device)
acpi_device_dir(device) = NULL; acpi_device_dir(device) = NULL;
} }
return_VALUE(0); return 0;
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
...@@ -186,14 +182,13 @@ static int acpi_fan_add(struct acpi_device *device) ...@@ -186,14 +182,13 @@ static int acpi_fan_add(struct acpi_device *device)
struct acpi_fan *fan = NULL; struct acpi_fan *fan = NULL;
int state = 0; int state = 0;
ACPI_FUNCTION_TRACE("acpi_fan_add");
if (!device) if (!device)
return_VALUE(-EINVAL); return -EINVAL;
fan = kmalloc(sizeof(struct acpi_fan), GFP_KERNEL); fan = kmalloc(sizeof(struct acpi_fan), GFP_KERNEL);
if (!fan) if (!fan)
return_VALUE(-ENOMEM); return -ENOMEM;
memset(fan, 0, sizeof(struct acpi_fan)); memset(fan, 0, sizeof(struct acpi_fan));
fan->handle = device->handle; fan->handle = device->handle;
...@@ -223,17 +218,16 @@ static int acpi_fan_add(struct acpi_device *device) ...@@ -223,17 +218,16 @@ static int acpi_fan_add(struct acpi_device *device)
if (result) if (result)
kfree(fan); kfree(fan);
return_VALUE(result); return result;
} }
static int acpi_fan_remove(struct acpi_device *device, int type) static int acpi_fan_remove(struct acpi_device *device, int type)
{ {
struct acpi_fan *fan = NULL; struct acpi_fan *fan = NULL;
ACPI_FUNCTION_TRACE("acpi_fan_remove");
if (!device || !acpi_driver_data(device)) if (!device || !acpi_driver_data(device))
return_VALUE(-EINVAL); return -EINVAL;
fan = (struct acpi_fan *)acpi_driver_data(device); fan = (struct acpi_fan *)acpi_driver_data(device);
...@@ -241,7 +235,7 @@ static int acpi_fan_remove(struct acpi_device *device, int type) ...@@ -241,7 +235,7 @@ static int acpi_fan_remove(struct acpi_device *device, int type)
kfree(fan); kfree(fan);
return_VALUE(0); return 0;
} }
static int acpi_fan_suspend(struct acpi_device *device, int state) static int acpi_fan_suspend(struct acpi_device *device, int state)
...@@ -280,31 +274,29 @@ static int __init acpi_fan_init(void) ...@@ -280,31 +274,29 @@ static int __init acpi_fan_init(void)
{ {
int result = 0; int result = 0;
ACPI_FUNCTION_TRACE("acpi_fan_init");
acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir); acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir);
if (!acpi_fan_dir) if (!acpi_fan_dir)
return_VALUE(-ENODEV); return -ENODEV;
acpi_fan_dir->owner = THIS_MODULE; acpi_fan_dir->owner = THIS_MODULE;
result = acpi_bus_register_driver(&acpi_fan_driver); result = acpi_bus_register_driver(&acpi_fan_driver);
if (result < 0) { if (result < 0) {
remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir); remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
return_VALUE(-ENODEV); return -ENODEV;
} }
return_VALUE(0); return 0;
} }
static void __exit acpi_fan_exit(void) static void __exit acpi_fan_exit(void)
{ {
ACPI_FUNCTION_TRACE("acpi_fan_exit");
acpi_bus_unregister_driver(&acpi_fan_driver); acpi_bus_unregister_driver(&acpi_fan_driver);
remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir); remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
return_VOID; return;
} }
module_init(acpi_fan_init); module_init(acpi_fan_init);
......
This diff is collapsed.
...@@ -52,13 +52,12 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data) ...@@ -52,13 +52,12 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data)
{ {
struct resource *requested_res = NULL; struct resource *requested_res = NULL;
ACPI_FUNCTION_TRACE("acpi_reserve_io_ranges");
if (res->type == ACPI_RESOURCE_TYPE_IO) { if (res->type == ACPI_RESOURCE_TYPE_IO) {
struct acpi_resource_io *io_res = &res->data.io; struct acpi_resource_io *io_res = &res->data.io;
if (io_res->minimum != io_res->maximum) if (io_res->minimum != io_res->maximum)
return_VALUE(AE_OK); return AE_OK;
if (IS_RESERVED_ADDR if (IS_RESERVED_ADDR
(io_res->minimum, io_res->address_length)) { (io_res->minimum, io_res->address_length)) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
...@@ -92,7 +91,7 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data) ...@@ -92,7 +91,7 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data)
if (requested_res) if (requested_res)
requested_res->flags &= ~IORESOURCE_BUSY; requested_res->flags &= ~IORESOURCE_BUSY;
return_VALUE(AE_OK); return AE_OK;
} }
static int acpi_motherboard_add(struct acpi_device *device) static int acpi_motherboard_add(struct acpi_device *device)
......
...@@ -587,19 +587,18 @@ static void acpi_os_execute_deferred(void *context) ...@@ -587,19 +587,18 @@ static void acpi_os_execute_deferred(void *context)
{ {
struct acpi_os_dpc *dpc = NULL; struct acpi_os_dpc *dpc = NULL;
ACPI_FUNCTION_TRACE("os_execute_deferred");
dpc = (struct acpi_os_dpc *)context; dpc = (struct acpi_os_dpc *)context;
if (!dpc) { if (!dpc) {
printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
return_VOID; return;
} }
dpc->function(dpc->context); dpc->function(dpc->context);
kfree(dpc); kfree(dpc);
return_VOID; return;
} }
static int acpi_os_execute_thread(void *context) static int acpi_os_execute_thread(void *context)
...@@ -693,7 +692,6 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle) ...@@ -693,7 +692,6 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle)
{ {
spinlock_t *lock_ptr; spinlock_t *lock_ptr;
ACPI_FUNCTION_TRACE("os_create_lock");
lock_ptr = acpi_os_allocate(sizeof(spinlock_t)); lock_ptr = acpi_os_allocate(sizeof(spinlock_t));
...@@ -703,7 +701,7 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle) ...@@ -703,7 +701,7 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle)
*out_handle = lock_ptr; *out_handle = lock_ptr;
return_ACPI_STATUS(AE_OK); return AE_OK;
} }
/* /*
...@@ -711,13 +709,12 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle) ...@@ -711,13 +709,12 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle)
*/ */
void acpi_os_delete_lock(acpi_handle handle) void acpi_os_delete_lock(acpi_handle handle)
{ {
ACPI_FUNCTION_TRACE("os_create_lock");
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting spinlock[%p].\n", handle)); ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting spinlock[%p].\n", handle));
acpi_os_free(handle); acpi_os_free(handle);
return_VOID; return;
} }
acpi_status acpi_status
...@@ -725,11 +722,10 @@ acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle) ...@@ -725,11 +722,10 @@ acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle)
{ {
struct semaphore *sem = NULL; struct semaphore *sem = NULL;
ACPI_FUNCTION_TRACE("os_create_semaphore");
sem = acpi_os_allocate(sizeof(struct semaphore)); sem = acpi_os_allocate(sizeof(struct semaphore));
if (!sem) if (!sem)
return_ACPI_STATUS(AE_NO_MEMORY); return AE_NO_MEMORY;
memset(sem, 0, sizeof(struct semaphore)); memset(sem, 0, sizeof(struct semaphore));
sema_init(sem, initial_units); sema_init(sem, initial_units);
...@@ -739,7 +735,7 @@ acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle) ...@@ -739,7 +735,7 @@ acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle)
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Creating semaphore[%p|%d].\n", ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Creating semaphore[%p|%d].\n",
*handle, initial_units)); *handle, initial_units));
return_ACPI_STATUS(AE_OK); return AE_OK;
} }
EXPORT_SYMBOL(acpi_os_create_semaphore); EXPORT_SYMBOL(acpi_os_create_semaphore);
...@@ -755,17 +751,16 @@ acpi_status acpi_os_delete_semaphore(acpi_handle handle) ...@@ -755,17 +751,16 @@ acpi_status acpi_os_delete_semaphore(acpi_handle handle)
{ {
struct semaphore *sem = (struct semaphore *)handle; struct semaphore *sem = (struct semaphore *)handle;
ACPI_FUNCTION_TRACE("os_delete_semaphore");
if (!sem) if (!sem)
return_ACPI_STATUS(AE_BAD_PARAMETER); return AE_BAD_PARAMETER;
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting semaphore[%p].\n", handle)); ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting semaphore[%p].\n", handle));
acpi_os_free(sem); acpi_os_free(sem);
sem = NULL; sem = NULL;
return_ACPI_STATUS(AE_OK); return AE_OK;
} }
EXPORT_SYMBOL(acpi_os_delete_semaphore); EXPORT_SYMBOL(acpi_os_delete_semaphore);
...@@ -785,13 +780,12 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout) ...@@ -785,13 +780,12 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
struct semaphore *sem = (struct semaphore *)handle; struct semaphore *sem = (struct semaphore *)handle;
int ret = 0; int ret = 0;
ACPI_FUNCTION_TRACE("os_wait_semaphore");
if (!sem || (units < 1)) if (!sem || (units < 1))
return_ACPI_STATUS(AE_BAD_PARAMETER); return AE_BAD_PARAMETER;
if (units > 1) if (units > 1)
return_ACPI_STATUS(AE_SUPPORT); return AE_SUPPORT;
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n", ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n",
handle, units, timeout)); handle, units, timeout));
...@@ -850,7 +844,7 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout) ...@@ -850,7 +844,7 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
units, timeout)); units, timeout));
} }
return_ACPI_STATUS(status); return status;
} }
EXPORT_SYMBOL(acpi_os_wait_semaphore); EXPORT_SYMBOL(acpi_os_wait_semaphore);
...@@ -862,20 +856,19 @@ acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units) ...@@ -862,20 +856,19 @@ acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units)
{ {
struct semaphore *sem = (struct semaphore *)handle; struct semaphore *sem = (struct semaphore *)handle;
ACPI_FUNCTION_TRACE("os_signal_semaphore");
if (!sem || (units < 1)) if (!sem || (units < 1))
return_ACPI_STATUS(AE_BAD_PARAMETER); return AE_BAD_PARAMETER;
if (units > 1) if (units > 1)
return_ACPI_STATUS(AE_SUPPORT); return AE_SUPPORT;
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Signaling semaphore[%p|%d]\n", handle, ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Signaling semaphore[%p|%d]\n", handle,
units)); units));
up(sem); up(sem);
return_ACPI_STATUS(AE_OK); return AE_OK;
} }
EXPORT_SYMBOL(acpi_os_signal_semaphore); EXPORT_SYMBOL(acpi_os_signal_semaphore);
......
...@@ -47,11 +47,10 @@ struct acpi_pci_data { ...@@ -47,11 +47,10 @@ struct acpi_pci_data {
static void acpi_pci_data_handler(acpi_handle handle, u32 function, static void acpi_pci_data_handler(acpi_handle handle, u32 function,
void *context) void *context)
{ {
ACPI_FUNCTION_TRACE("acpi_pci_data_handler");
/* TBD: Anything we need to do here? */ /* TBD: Anything we need to do here? */
return_VOID; return;
} }
/** /**
...@@ -68,17 +67,16 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id) ...@@ -68,17 +67,16 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id)
struct acpi_device *device = NULL; struct acpi_device *device = NULL;
struct acpi_pci_data *data = NULL; struct acpi_pci_data *data = NULL;
ACPI_FUNCTION_TRACE("acpi_get_pci_id");
if (!id) if (!id)
return_ACPI_STATUS(AE_BAD_PARAMETER); return AE_BAD_PARAMETER;
result = acpi_bus_get_device(handle, &device); result = acpi_bus_get_device(handle, &device);
if (result) { if (result) {
printk(KERN_ERR PREFIX printk(KERN_ERR PREFIX
"Invalid ACPI Bus context for device %s\n", "Invalid ACPI Bus context for device %s\n",
acpi_device_bid(device)); acpi_device_bid(device));
return_ACPI_STATUS(AE_NOT_EXIST); return AE_NOT_EXIST;
} }
status = acpi_get_data(handle, acpi_pci_data_handler, (void **)&data); status = acpi_get_data(handle, acpi_pci_data_handler, (void **)&data);
...@@ -86,7 +84,7 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id) ...@@ -86,7 +84,7 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id)
ACPI_EXCEPTION((AE_INFO, status, ACPI_EXCEPTION((AE_INFO, status,
"Invalid ACPI-PCI context for device %s", "Invalid ACPI-PCI context for device %s",
acpi_device_bid(device))); acpi_device_bid(device)));
return_ACPI_STATUS(status); return status;
} }
*id = data->id; *id = data->id;
...@@ -103,7 +101,7 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id) ...@@ -103,7 +101,7 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id)
acpi_device_bid(device), id->segment, id->bus, acpi_device_bid(device), id->segment, id->bus,
id->device, id->function)); id->device, id->function));
return_ACPI_STATUS(AE_OK); return AE_OK;
} }
EXPORT_SYMBOL(acpi_get_pci_id); EXPORT_SYMBOL(acpi_get_pci_id);
...@@ -120,14 +118,13 @@ int acpi_pci_bind(struct acpi_device *device) ...@@ -120,14 +118,13 @@ int acpi_pci_bind(struct acpi_device *device)
struct pci_dev *dev; struct pci_dev *dev;
struct pci_bus *bus; struct pci_bus *bus;
ACPI_FUNCTION_TRACE("acpi_pci_bind");
if (!device || !device->parent) if (!device || !device->parent)
return_VALUE(-EINVAL); return -EINVAL;
pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
if (!pathname) if (!pathname)
return_VALUE(-ENOMEM); return -ENOMEM;
memset(pathname, 0, ACPI_PATHNAME_MAX); memset(pathname, 0, ACPI_PATHNAME_MAX);
buffer.length = ACPI_PATHNAME_MAX; buffer.length = ACPI_PATHNAME_MAX;
buffer.pointer = pathname; buffer.pointer = pathname;
...@@ -135,7 +132,7 @@ int acpi_pci_bind(struct acpi_device *device) ...@@ -135,7 +132,7 @@ int acpi_pci_bind(struct acpi_device *device)
data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL); data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
if (!data) { if (!data) {
kfree(pathname); kfree(pathname);
return_VALUE(-ENOMEM); return -ENOMEM;
} }
memset(data, 0, sizeof(struct acpi_pci_data)); memset(data, 0, sizeof(struct acpi_pci_data));
...@@ -269,7 +266,7 @@ int acpi_pci_bind(struct acpi_device *device) ...@@ -269,7 +266,7 @@ int acpi_pci_bind(struct acpi_device *device)
if (result) if (result)
kfree(data); kfree(data);
return_VALUE(result); return result;
} }
int acpi_pci_unbind(struct acpi_device *device) int acpi_pci_unbind(struct acpi_device *device)
...@@ -280,14 +277,13 @@ int acpi_pci_unbind(struct acpi_device *device) ...@@ -280,14 +277,13 @@ int acpi_pci_unbind(struct acpi_device *device)
char *pathname = NULL; char *pathname = NULL;
struct acpi_buffer buffer = { 0, NULL }; struct acpi_buffer buffer = { 0, NULL };
ACPI_FUNCTION_TRACE("acpi_pci_unbind");
if (!device || !device->parent) if (!device || !device->parent)
return_VALUE(-EINVAL); return -EINVAL;
pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
if (!pathname) if (!pathname)
return_VALUE(-ENOMEM); return -ENOMEM;
memset(pathname, 0, ACPI_PATHNAME_MAX); memset(pathname, 0, ACPI_PATHNAME_MAX);
buffer.length = ACPI_PATHNAME_MAX; buffer.length = ACPI_PATHNAME_MAX;
...@@ -322,7 +318,7 @@ int acpi_pci_unbind(struct acpi_device *device) ...@@ -322,7 +318,7 @@ int acpi_pci_unbind(struct acpi_device *device)
kfree(data); kfree(data);
end: end:
return_VALUE(result); return result;
} }
int int
...@@ -335,11 +331,10 @@ acpi_pci_bind_root(struct acpi_device *device, ...@@ -335,11 +331,10 @@ acpi_pci_bind_root(struct acpi_device *device,
char *pathname = NULL; char *pathname = NULL;
struct acpi_buffer buffer = { 0, NULL }; struct acpi_buffer buffer = { 0, NULL };
ACPI_FUNCTION_TRACE("acpi_pci_bind_root");
pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
if (!pathname) if (!pathname)
return_VALUE(-ENOMEM); return -ENOMEM;
memset(pathname, 0, ACPI_PATHNAME_MAX); memset(pathname, 0, ACPI_PATHNAME_MAX);
buffer.length = ACPI_PATHNAME_MAX; buffer.length = ACPI_PATHNAME_MAX;
...@@ -347,13 +342,13 @@ acpi_pci_bind_root(struct acpi_device *device, ...@@ -347,13 +342,13 @@ acpi_pci_bind_root(struct acpi_device *device,
if (!device || !id || !bus) { if (!device || !id || !bus) {
kfree(pathname); kfree(pathname);
return_VALUE(-EINVAL); return -EINVAL;
} }
data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL); data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
if (!data) { if (!data) {
kfree(pathname); kfree(pathname);
return_VALUE(-ENOMEM); return -ENOMEM;
} }
memset(data, 0, sizeof(struct acpi_pci_data)); memset(data, 0, sizeof(struct acpi_pci_data));
...@@ -381,5 +376,5 @@ acpi_pci_bind_root(struct acpi_device *device, ...@@ -381,5 +376,5 @@ acpi_pci_bind_root(struct acpi_device *device,
if (result != 0) if (result != 0)
kfree(data); kfree(data);
return_VALUE(result); return result;
} }
...@@ -55,10 +55,9 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(int segment, ...@@ -55,10 +55,9 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(int segment,
struct list_head *node = NULL; struct list_head *node = NULL;
struct acpi_prt_entry *entry = NULL; struct acpi_prt_entry *entry = NULL;
ACPI_FUNCTION_TRACE("acpi_pci_irq_find_prt_entry");
if (!acpi_prt.count) if (!acpi_prt.count)
return_PTR(NULL); return NULL;
/* /*
* Parse through all PRT entries looking for a match on the specified * Parse through all PRT entries looking for a match on the specified
...@@ -73,12 +72,12 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(int segment, ...@@ -73,12 +72,12 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(int segment,
&& (device == entry->id.device) && (device == entry->id.device)
&& (pin == entry->pin)) { && (pin == entry->pin)) {
spin_unlock(&acpi_prt_lock); spin_unlock(&acpi_prt_lock);
return_PTR(entry); return entry;
} }
} }
spin_unlock(&acpi_prt_lock); spin_unlock(&acpi_prt_lock);
return_PTR(NULL); return NULL;
} }
static int static int
...@@ -87,14 +86,13 @@ acpi_pci_irq_add_entry(acpi_handle handle, ...@@ -87,14 +86,13 @@ acpi_pci_irq_add_entry(acpi_handle handle,
{ {
struct acpi_prt_entry *entry = NULL; struct acpi_prt_entry *entry = NULL;
ACPI_FUNCTION_TRACE("acpi_pci_irq_add_entry");
if (!prt) if (!prt)
return_VALUE(-EINVAL); return -EINVAL;
entry = kmalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL); entry = kmalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL);
if (!entry) if (!entry)
return_VALUE(-ENOMEM); return -ENOMEM;
memset(entry, 0, sizeof(struct acpi_prt_entry)); memset(entry, 0, sizeof(struct acpi_prt_entry));
entry->id.segment = segment; entry->id.segment = segment;
...@@ -141,7 +139,7 @@ acpi_pci_irq_add_entry(acpi_handle handle, ...@@ -141,7 +139,7 @@ acpi_pci_irq_add_entry(acpi_handle handle,
acpi_prt.count++; acpi_prt.count++;
spin_unlock(&acpi_prt_lock); spin_unlock(&acpi_prt_lock);
return_VALUE(0); return 0;
} }
static void static void
...@@ -163,11 +161,10 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus) ...@@ -163,11 +161,10 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
struct acpi_pci_routing_table *entry = NULL; struct acpi_pci_routing_table *entry = NULL;
static int first_time = 1; static int first_time = 1;
ACPI_FUNCTION_TRACE("acpi_pci_irq_add_prt");
pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL); pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
if (!pathname) if (!pathname)
return_VALUE(-ENOMEM); return -ENOMEM;
memset(pathname, 0, ACPI_PATHNAME_MAX); memset(pathname, 0, ACPI_PATHNAME_MAX);
if (first_time) { if (first_time) {
...@@ -199,12 +196,12 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus) ...@@ -199,12 +196,12 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
if (status != AE_BUFFER_OVERFLOW) { if (status != AE_BUFFER_OVERFLOW) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]", ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]",
acpi_format_exception(status))); acpi_format_exception(status)));
return_VALUE(-ENODEV); return -ENODEV;
} }
prt = kmalloc(buffer.length, GFP_KERNEL); prt = kmalloc(buffer.length, GFP_KERNEL);
if (!prt) { if (!prt) {
return_VALUE(-ENOMEM); return -ENOMEM;
} }
memset(prt, 0, buffer.length); memset(prt, 0, buffer.length);
buffer.pointer = prt; buffer.pointer = prt;
...@@ -214,7 +211,7 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus) ...@@ -214,7 +211,7 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]", ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]",
acpi_format_exception(status))); acpi_format_exception(status)));
kfree(buffer.pointer); kfree(buffer.pointer);
return_VALUE(-ENODEV); return -ENODEV;
} }
entry = prt; entry = prt;
...@@ -227,7 +224,7 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus) ...@@ -227,7 +224,7 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
kfree(prt); kfree(prt);
return_VALUE(0); return 0;
} }
void acpi_pci_irq_del_prt(int segment, int bus) void acpi_pci_irq_del_prt(int segment, int bus)
...@@ -262,7 +259,6 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry, ...@@ -262,7 +259,6 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
{ {
int irq; int irq;
ACPI_FUNCTION_TRACE("acpi_pci_allocate_irq");
if (entry->link.handle) { if (entry->link.handle) {
irq = acpi_pci_link_allocate_irq(entry->link.handle, irq = acpi_pci_link_allocate_irq(entry->link.handle,
...@@ -271,7 +267,7 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry, ...@@ -271,7 +267,7 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
if (irq < 0) { if (irq < 0) {
printk(KERN_WARNING PREFIX printk(KERN_WARNING PREFIX
"Invalid IRQ link routing entry\n"); "Invalid IRQ link routing entry\n");
return_VALUE(-1); return -1;
} }
} else { } else {
irq = entry->link.index; irq = entry->link.index;
...@@ -280,7 +276,7 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry, ...@@ -280,7 +276,7 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
} }
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq)); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq));
return_VALUE(irq); return irq;
} }
static int static int
...@@ -289,13 +285,12 @@ acpi_pci_free_irq(struct acpi_prt_entry *entry, ...@@ -289,13 +285,12 @@ acpi_pci_free_irq(struct acpi_prt_entry *entry,
{ {
int irq; int irq;
ACPI_FUNCTION_TRACE("acpi_pci_free_irq");
if (entry->link.handle) { if (entry->link.handle) {
irq = acpi_pci_link_free_irq(entry->link.handle); irq = acpi_pci_link_free_irq(entry->link.handle);
} else { } else {
irq = entry->link.index; irq = entry->link.index;
} }
return_VALUE(irq); return irq;
} }
/* /*
...@@ -315,7 +310,6 @@ acpi_pci_irq_lookup(struct pci_bus *bus, ...@@ -315,7 +310,6 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
int bus_nr = bus->number; int bus_nr = bus->number;
int ret; int ret;
ACPI_FUNCTION_TRACE("acpi_pci_irq_lookup");
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Searching for PRT entry for %02x:%02x:%02x[%c]\n", "Searching for PRT entry for %02x:%02x:%02x[%c]\n",
...@@ -324,11 +318,11 @@ acpi_pci_irq_lookup(struct pci_bus *bus, ...@@ -324,11 +318,11 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
entry = acpi_pci_irq_find_prt_entry(segment, bus_nr, device, pin); entry = acpi_pci_irq_find_prt_entry(segment, bus_nr, device, pin);
if (!entry) { if (!entry) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PRT entry not found\n")); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PRT entry not found\n"));
return_VALUE(-1); return -1;
} }
ret = func(entry, triggering, polarity, link); ret = func(entry, triggering, polarity, link);
return_VALUE(ret); return ret;
} }
/* /*
...@@ -346,10 +340,9 @@ acpi_pci_irq_derive(struct pci_dev *dev, ...@@ -346,10 +340,9 @@ acpi_pci_irq_derive(struct pci_dev *dev,
int irq = -1; int irq = -1;
u8 bridge_pin = 0; u8 bridge_pin = 0;
ACPI_FUNCTION_TRACE("acpi_pci_irq_derive");
if (!dev) if (!dev)
return_VALUE(-EINVAL); return -EINVAL;
/* /*
* Attempt to derive an IRQ for this device from a parent bridge's * Attempt to derive an IRQ for this device from a parent bridge's
...@@ -366,7 +359,7 @@ acpi_pci_irq_derive(struct pci_dev *dev, ...@@ -366,7 +359,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"No interrupt pin configured for device %s\n", "No interrupt pin configured for device %s\n",
pci_name(bridge))); pci_name(bridge)));
return_VALUE(-1); return -1;
} }
/* Pin is from 0 to 3 */ /* Pin is from 0 to 3 */
bridge_pin--; bridge_pin--;
...@@ -381,13 +374,13 @@ acpi_pci_irq_derive(struct pci_dev *dev, ...@@ -381,13 +374,13 @@ acpi_pci_irq_derive(struct pci_dev *dev,
if (irq < 0) { if (irq < 0) {
printk(KERN_WARNING PREFIX "Unable to derive IRQ for device %s\n", printk(KERN_WARNING PREFIX "Unable to derive IRQ for device %s\n",
pci_name(dev)); pci_name(dev));
return_VALUE(-1); return -1;
} }
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derive IRQ %d for device %s from %s\n", ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derive IRQ %d for device %s from %s\n",
irq, pci_name(dev), pci_name(bridge))); irq, pci_name(dev), pci_name(bridge)));
return_VALUE(irq); return irq;
} }
/* /*
...@@ -405,23 +398,22 @@ int acpi_pci_irq_enable(struct pci_dev *dev) ...@@ -405,23 +398,22 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
char *link = NULL; char *link = NULL;
int rc; int rc;
ACPI_FUNCTION_TRACE("acpi_pci_irq_enable");
if (!dev) if (!dev)
return_VALUE(-EINVAL); return -EINVAL;
pin = dev->pin; pin = dev->pin;
if (!pin) { if (!pin) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"No interrupt pin configured for device %s\n", "No interrupt pin configured for device %s\n",
pci_name(dev))); pci_name(dev)));
return_VALUE(0); return 0;
} }
pin--; pin--;
if (!dev->bus) { if (!dev->bus) {
printk(KERN_ERR PREFIX "Invalid (NULL) 'bus' field\n"); printk(KERN_ERR PREFIX "Invalid (NULL) 'bus' field\n");
return_VALUE(-ENODEV); return -ENODEV;
} }
/* /*
...@@ -453,10 +445,10 @@ int acpi_pci_irq_enable(struct pci_dev *dev) ...@@ -453,10 +445,10 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
printk(" - using IRQ %d\n", dev->irq); printk(" - using IRQ %d\n", dev->irq);
acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE, acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE,
ACPI_ACTIVE_LOW); ACPI_ACTIVE_LOW);
return_VALUE(0); return 0;
} else { } else {
printk("\n"); printk("\n");
return_VALUE(0); return 0;
} }
} }
...@@ -464,7 +456,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev) ...@@ -464,7 +456,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
if (rc < 0) { if (rc < 0) {
printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: failed " printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: failed "
"to register GSI\n", pci_name(dev), ('A' + pin)); "to register GSI\n", pci_name(dev), ('A' + pin));
return_VALUE(rc); return rc;
} }
dev->irq = rc; dev->irq = rc;
...@@ -478,7 +470,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev) ...@@ -478,7 +470,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
(triggering == ACPI_LEVEL_SENSITIVE) ? "level" : "edge", (triggering == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
(polarity == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq); (polarity == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq);
return_VALUE(0); return 0;
} }
EXPORT_SYMBOL(acpi_pci_irq_enable); EXPORT_SYMBOL(acpi_pci_irq_enable);
...@@ -495,14 +487,13 @@ void acpi_pci_irq_disable(struct pci_dev *dev) ...@@ -495,14 +487,13 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
int triggering = ACPI_LEVEL_SENSITIVE; int triggering = ACPI_LEVEL_SENSITIVE;
int polarity = ACPI_ACTIVE_LOW; int polarity = ACPI_ACTIVE_LOW;
ACPI_FUNCTION_TRACE("acpi_pci_irq_disable");
if (!dev || !dev->bus) if (!dev || !dev->bus)
return_VOID; return;
pin = dev->pin; pin = dev->pin;
if (!pin) if (!pin)
return_VOID; return;
pin--; pin--;
/* /*
...@@ -520,7 +511,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev) ...@@ -520,7 +511,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
&triggering, &polarity, NULL, &triggering, &polarity, NULL,
acpi_pci_free_irq); acpi_pci_free_irq);
if (gsi < 0) if (gsi < 0)
return_VOID; return;
/* /*
* TBD: It might be worth clearing dev->irq by magic constant * TBD: It might be worth clearing dev->irq by magic constant
...@@ -532,5 +523,5 @@ void acpi_pci_irq_disable(struct pci_dev *dev) ...@@ -532,5 +523,5 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
acpi_unregister_gsi(gsi); acpi_unregister_gsi(gsi);
return_VOID; return;
} }
This diff is collapsed.
...@@ -160,14 +160,13 @@ static int acpi_pci_root_add(struct acpi_device *device) ...@@ -160,14 +160,13 @@ static int acpi_pci_root_add(struct acpi_device *device)
unsigned long value = 0; unsigned long value = 0;
acpi_handle handle = NULL; acpi_handle handle = NULL;
ACPI_FUNCTION_TRACE("acpi_pci_root_add");
if (!device) if (!device)
return_VALUE(-EINVAL); return -EINVAL;
root = kmalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); root = kmalloc(sizeof(struct acpi_pci_root), GFP_KERNEL);
if (!root) if (!root)
return_VALUE(-ENOMEM); return -ENOMEM;
memset(root, 0, sizeof(struct acpi_pci_root)); memset(root, 0, sizeof(struct acpi_pci_root));
INIT_LIST_HEAD(&root->node); INIT_LIST_HEAD(&root->node);
...@@ -307,46 +306,43 @@ static int acpi_pci_root_add(struct acpi_device *device) ...@@ -307,46 +306,43 @@ static int acpi_pci_root_add(struct acpi_device *device)
kfree(root); kfree(root);
} }
return_VALUE(result); return result;
} }
static int acpi_pci_root_start(struct acpi_device *device) static int acpi_pci_root_start(struct acpi_device *device)
{ {
struct acpi_pci_root *root; struct acpi_pci_root *root;
ACPI_FUNCTION_TRACE("acpi_pci_root_start");
list_for_each_entry(root, &acpi_pci_roots, node) { list_for_each_entry(root, &acpi_pci_roots, node) {
if (root->handle == device->handle) { if (root->handle == device->handle) {
pci_bus_add_devices(root->bus); pci_bus_add_devices(root->bus);
return_VALUE(0); return 0;
} }
} }
return_VALUE(-ENODEV); return -ENODEV;
} }
static int acpi_pci_root_remove(struct acpi_device *device, int type) static int acpi_pci_root_remove(struct acpi_device *device, int type)
{ {
struct acpi_pci_root *root = NULL; struct acpi_pci_root *root = NULL;
ACPI_FUNCTION_TRACE("acpi_pci_root_remove");
if (!device || !acpi_driver_data(device)) if (!device || !acpi_driver_data(device))
return_VALUE(-EINVAL); return -EINVAL;
root = (struct acpi_pci_root *)acpi_driver_data(device); root = (struct acpi_pci_root *)acpi_driver_data(device);
kfree(root); kfree(root);
return_VALUE(0); return 0;
} }
static int __init acpi_pci_root_init(void) static int __init acpi_pci_root_init(void)
{ {
ACPI_FUNCTION_TRACE("acpi_pci_root_init");
if (acpi_pci_disabled) if (acpi_pci_disabled)
return_VALUE(0); return 0;
/* DEBUG: /* DEBUG:
acpi_dbg_layer = ACPI_PCI_COMPONENT; acpi_dbg_layer = ACPI_PCI_COMPONENT;
...@@ -354,9 +350,9 @@ static int __init acpi_pci_root_init(void) ...@@ -354,9 +350,9 @@ static int __init acpi_pci_root_init(void)
*/ */
if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0) if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0)
return_VALUE(-ENODEV); return -ENODEV;
return_VALUE(0); return 0;
} }
subsys_initcall(acpi_pci_root_init); subsys_initcall(acpi_pci_root_init);
This diff is collapsed.
This diff is collapsed.
...@@ -517,10 +517,9 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr) ...@@ -517,10 +517,9 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr)
struct acpi_processor_cx *higher = NULL; struct acpi_processor_cx *higher = NULL;
struct acpi_processor_cx *cx; struct acpi_processor_cx *cx;
ACPI_FUNCTION_TRACE("acpi_processor_set_power_policy");
if (!pr) if (!pr)
return_VALUE(-EINVAL); return -EINVAL;
/* /*
* This function sets the default Cx state policy (OS idle handler). * This function sets the default Cx state policy (OS idle handler).
...@@ -544,7 +543,7 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr) ...@@ -544,7 +543,7 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr)
} }
if (!state_is_set) if (!state_is_set)
return_VALUE(-ENODEV); return -ENODEV;
/* demotion */ /* demotion */
for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
...@@ -583,18 +582,17 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr) ...@@ -583,18 +582,17 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr)
higher = cx; higher = cx;
} }
return_VALUE(0); return 0;
} }
static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
{ {
ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_fadt");
if (!pr) if (!pr)
return_VALUE(-EINVAL); return -EINVAL;
if (!pr->pblk) if (!pr->pblk)
return_VALUE(-ENODEV); return -ENODEV;
/* if info is obtained from pblk/fadt, type equals state */ /* if info is obtained from pblk/fadt, type equals state */
pr->power.states[ACPI_STATE_C2].type = ACPI_STATE_C2; pr->power.states[ACPI_STATE_C2].type = ACPI_STATE_C2;
...@@ -606,7 +604,7 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) ...@@ -606,7 +604,7 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
* an SMP system. * an SMP system.
*/ */
if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up) if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up)
return_VALUE(-ENODEV); return -ENODEV;
#endif #endif
/* determine C2 and C3 address from pblk */ /* determine C2 and C3 address from pblk */
...@@ -622,12 +620,11 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) ...@@ -622,12 +620,11 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
pr->power.states[ACPI_STATE_C2].address, pr->power.states[ACPI_STATE_C2].address,
pr->power.states[ACPI_STATE_C3].address)); pr->power.states[ACPI_STATE_C3].address));
return_VALUE(0); return 0;
} }
static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr) static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr)
{ {
ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1");
/* Zero initialize all the C-states info. */ /* Zero initialize all the C-states info. */
memset(pr->power.states, 0, sizeof(pr->power.states)); memset(pr->power.states, 0, sizeof(pr->power.states));
...@@ -640,7 +637,7 @@ static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr) ...@@ -640,7 +637,7 @@ static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr)
pr->power.states[ACPI_STATE_C0].valid = 1; pr->power.states[ACPI_STATE_C0].valid = 1;
pr->power.states[ACPI_STATE_C1].valid = 1; pr->power.states[ACPI_STATE_C1].valid = 1;
return_VALUE(0); return 0;
} }
static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
...@@ -652,10 +649,9 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) ...@@ -652,10 +649,9 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *cst; union acpi_object *cst;
ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_cst");
if (nocst) if (nocst)
return_VALUE(-ENODEV); return -ENODEV;
current_count = 1; current_count = 1;
...@@ -667,7 +663,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) ...@@ -667,7 +663,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
status = acpi_evaluate_object(pr->handle, "_CST", NULL, &buffer); status = acpi_evaluate_object(pr->handle, "_CST", NULL, &buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No _CST, giving up\n")); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No _CST, giving up\n"));
return_VALUE(-ENODEV); return -ENODEV;
} }
cst = (union acpi_object *)buffer.pointer; cst = (union acpi_object *)buffer.pointer;
...@@ -773,15 +769,14 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) ...@@ -773,15 +769,14 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
end: end:
acpi_os_free(buffer.pointer); acpi_os_free(buffer.pointer);
return_VALUE(status); return status;
} }
static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx) static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx)
{ {
ACPI_FUNCTION_TRACE("acpi_processor_get_power_verify_c2");
if (!cx->address) if (!cx->address)
return_VOID; return;
/* /*
* C2 latency must be less than or equal to 100 * C2 latency must be less than or equal to 100
...@@ -790,7 +785,7 @@ static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx) ...@@ -790,7 +785,7 @@ static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx)
else if (cx->latency > ACPI_PROCESSOR_MAX_C2_LATENCY) { else if (cx->latency > ACPI_PROCESSOR_MAX_C2_LATENCY) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"latency too large [%d]\n", cx->latency)); "latency too large [%d]\n", cx->latency));
return_VOID; return;
} }
/* /*
...@@ -800,7 +795,7 @@ static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx) ...@@ -800,7 +795,7 @@ static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx)
cx->valid = 1; cx->valid = 1;
cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency); cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency);
return_VOID; return;
} }
static void acpi_processor_power_verify_c3(struct acpi_processor *pr, static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
...@@ -808,10 +803,9 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, ...@@ -808,10 +803,9 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
{ {
static int bm_check_flag; static int bm_check_flag;
ACPI_FUNCTION_TRACE("acpi_processor_get_power_verify_c3");
if (!cx->address) if (!cx->address)
return_VOID; return;
/* /*
* C3 latency must be less than or equal to 1000 * C3 latency must be less than or equal to 1000
...@@ -820,7 +814,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, ...@@ -820,7 +814,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
else if (cx->latency > ACPI_PROCESSOR_MAX_C3_LATENCY) { else if (cx->latency > ACPI_PROCESSOR_MAX_C3_LATENCY) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"latency too large [%d]\n", cx->latency)); "latency too large [%d]\n", cx->latency));
return_VOID; return;
} }
/* /*
...@@ -833,7 +827,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, ...@@ -833,7 +827,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
else if (errata.piix4.fdma) { else if (errata.piix4.fdma) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"C3 not supported on PIIX4 with Type-F DMA\n")); "C3 not supported on PIIX4 with Type-F DMA\n"));
return_VOID; return;
} }
/* All the logic here assumes flags.bm_check is same across all CPUs */ /* All the logic here assumes flags.bm_check is same across all CPUs */
...@@ -850,7 +844,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, ...@@ -850,7 +844,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
if (!pr->flags.bm_control) { if (!pr->flags.bm_control) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"C3 support requires bus mastering control\n")); "C3 support requires bus mastering control\n"));
return_VOID; return;
} }
} else { } else {
/* /*
...@@ -861,7 +855,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, ...@@ -861,7 +855,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Cache invalidation should work properly" "Cache invalidation should work properly"
" for C3 to be enabled on SMP systems\n")); " for C3 to be enabled on SMP systems\n"));
return_VOID; return;
} }
acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD,
0, ACPI_MTX_DO_NOT_LOCK); 0, ACPI_MTX_DO_NOT_LOCK);
...@@ -876,7 +870,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, ...@@ -876,7 +870,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
cx->valid = 1; cx->valid = 1;
cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency); cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency);
return_VOID; return;
} }
static int acpi_processor_power_verify(struct acpi_processor *pr) static int acpi_processor_power_verify(struct acpi_processor *pr)
...@@ -935,7 +929,6 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) ...@@ -935,7 +929,6 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr)
unsigned int i; unsigned int i;
int result; int result;
ACPI_FUNCTION_TRACE("acpi_processor_get_power_info");
/* NOTE: the idle thread may not be running while calling /* NOTE: the idle thread may not be running while calling
* this function */ * this function */
...@@ -958,7 +951,7 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) ...@@ -958,7 +951,7 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr)
*/ */
result = acpi_processor_set_power_policy(pr); result = acpi_processor_set_power_policy(pr);
if (result) if (result)
return_VALUE(result); return result;
/* /*
* if one state of type C2 or C3 is available, mark this * if one state of type C2 or C3 is available, mark this
...@@ -972,24 +965,23 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) ...@@ -972,24 +965,23 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr)
} }
} }
return_VALUE(0); return 0;
} }
int acpi_processor_cst_has_changed(struct acpi_processor *pr) int acpi_processor_cst_has_changed(struct acpi_processor *pr)
{ {
int result = 0; int result = 0;
ACPI_FUNCTION_TRACE("acpi_processor_cst_has_changed");
if (!pr) if (!pr)
return_VALUE(-EINVAL); return -EINVAL;
if (nocst) { if (nocst) {
return_VALUE(-ENODEV); return -ENODEV;
} }
if (!pr->flags.power_setup_done) if (!pr->flags.power_setup_done)
return_VALUE(-ENODEV); return -ENODEV;
/* Fall back to the default idle loop */ /* Fall back to the default idle loop */
pm_idle = pm_idle_save; pm_idle = pm_idle_save;
...@@ -1000,7 +992,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) ...@@ -1000,7 +992,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
if ((pr->flags.power == 1) && (pr->flags.power_setup_done)) if ((pr->flags.power == 1) && (pr->flags.power_setup_done))
pm_idle = acpi_processor_idle; pm_idle = acpi_processor_idle;
return_VALUE(result); return result;
} }
/* proc interface */ /* proc interface */
...@@ -1010,7 +1002,6 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) ...@@ -1010,7 +1002,6 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset)
struct acpi_processor *pr = (struct acpi_processor *)seq->private; struct acpi_processor *pr = (struct acpi_processor *)seq->private;
unsigned int i; unsigned int i;
ACPI_FUNCTION_TRACE("acpi_processor_power_seq_show");
if (!pr) if (!pr)
goto end; goto end;
...@@ -1068,7 +1059,7 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) ...@@ -1068,7 +1059,7 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset)
} }
end: end:
return_VALUE(0); return 0;
} }
static int acpi_processor_power_open_fs(struct inode *inode, struct file *file) static int acpi_processor_power_open_fs(struct inode *inode, struct file *file)
...@@ -1092,7 +1083,6 @@ int acpi_processor_power_init(struct acpi_processor *pr, ...@@ -1092,7 +1083,6 @@ int acpi_processor_power_init(struct acpi_processor *pr,
struct proc_dir_entry *entry = NULL; struct proc_dir_entry *entry = NULL;
unsigned int i; unsigned int i;
ACPI_FUNCTION_TRACE("acpi_processor_power_init");
if (!first_run) { if (!first_run) {
dmi_check_system(processor_power_dmi_table); dmi_check_system(processor_power_dmi_table);
...@@ -1104,7 +1094,7 @@ int acpi_processor_power_init(struct acpi_processor *pr, ...@@ -1104,7 +1094,7 @@ int acpi_processor_power_init(struct acpi_processor *pr,
} }
if (!pr) if (!pr)
return_VALUE(-EINVAL); return -EINVAL;
if (acpi_fadt.cst_cnt && !nocst) { if (acpi_fadt.cst_cnt && !nocst) {
status = status =
...@@ -1149,13 +1139,12 @@ int acpi_processor_power_init(struct acpi_processor *pr, ...@@ -1149,13 +1139,12 @@ int acpi_processor_power_init(struct acpi_processor *pr,
pr->flags.power_setup_done = 1; pr->flags.power_setup_done = 1;
return_VALUE(0); return 0;
} }
int acpi_processor_power_exit(struct acpi_processor *pr, int acpi_processor_power_exit(struct acpi_processor *pr,
struct acpi_device *device) struct acpi_device *device)
{ {
ACPI_FUNCTION_TRACE("acpi_processor_power_exit");
pr->flags.power_setup_done = 0; pr->flags.power_setup_done = 0;
...@@ -1175,5 +1164,5 @@ int acpi_processor_power_exit(struct acpi_processor *pr, ...@@ -1175,5 +1164,5 @@ int acpi_processor_power_exit(struct acpi_processor *pr,
cpu_idle_wait(); cpu_idle_wait();
} }
return_VALUE(0); return 0;
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -47,10 +47,9 @@ extern struct fadt_descriptor acpi_fadt; ...@@ -47,10 +47,9 @@ extern struct fadt_descriptor acpi_fadt;
static int acpi_system_read_info(struct seq_file *seq, void *offset) static int acpi_system_read_info(struct seq_file *seq, void *offset)
{ {
ACPI_FUNCTION_TRACE("acpi_system_read_info");
seq_printf(seq, "version: %x\n", ACPI_CA_VERSION); seq_printf(seq, "version: %x\n", ACPI_CA_VERSION);
return_VALUE(0); return 0;
} }
static int acpi_system_info_open_fs(struct inode *inode, struct file *file) static int acpi_system_info_open_fs(struct inode *inode, struct file *file)
...@@ -80,17 +79,16 @@ acpi_system_read_dsdt(struct file *file, ...@@ -80,17 +79,16 @@ acpi_system_read_dsdt(struct file *file,
struct acpi_buffer dsdt = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer dsdt = { ACPI_ALLOCATE_BUFFER, NULL };
ssize_t res; ssize_t res;
ACPI_FUNCTION_TRACE("acpi_system_read_dsdt");
status = acpi_get_table(ACPI_TABLE_ID_DSDT, 1, &dsdt); status = acpi_get_table(ACPI_TABLE_ID_DSDT, 1, &dsdt);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return_VALUE(-ENODEV); return -ENODEV;
res = simple_read_from_buffer(buffer, count, ppos, res = simple_read_from_buffer(buffer, count, ppos,
dsdt.pointer, dsdt.length); dsdt.pointer, dsdt.length);
acpi_os_free(dsdt.pointer); acpi_os_free(dsdt.pointer);
return_VALUE(res); return res;
} }
static ssize_t acpi_system_read_fadt(struct file *, char __user *, size_t, static ssize_t acpi_system_read_fadt(struct file *, char __user *, size_t,
...@@ -108,17 +106,16 @@ acpi_system_read_fadt(struct file *file, ...@@ -108,17 +106,16 @@ acpi_system_read_fadt(struct file *file,
struct acpi_buffer fadt = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer fadt = { ACPI_ALLOCATE_BUFFER, NULL };
ssize_t res; ssize_t res;
ACPI_FUNCTION_TRACE("acpi_system_read_fadt");
status = acpi_get_table(ACPI_TABLE_ID_FADT, 1, &fadt); status = acpi_get_table(ACPI_TABLE_ID_FADT, 1, &fadt);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return_VALUE(-ENODEV); return -ENODEV;
res = simple_read_from_buffer(buffer, count, ppos, res = simple_read_from_buffer(buffer, count, ppos,
fadt.pointer, fadt.length); fadt.pointer, fadt.length);
acpi_os_free(fadt.pointer); acpi_os_free(fadt.pointer);
return_VALUE(res); return res;
} }
static int __init acpi_system_init(void) static int __init acpi_system_init(void)
...@@ -127,10 +124,9 @@ static int __init acpi_system_init(void) ...@@ -127,10 +124,9 @@ static int __init acpi_system_init(void)
int error = 0; int error = 0;
char *name; char *name;
ACPI_FUNCTION_TRACE("acpi_system_init");
if (acpi_disabled) if (acpi_disabled)
return_VALUE(0); return 0;
/* 'info' [R] */ /* 'info' [R] */
name = ACPI_SYSTEM_FILE_INFO; name = ACPI_SYSTEM_FILE_INFO;
...@@ -158,7 +154,7 @@ static int __init acpi_system_init(void) ...@@ -158,7 +154,7 @@ static int __init acpi_system_init(void)
goto Error; goto Error;
Done: Done:
return_VALUE(error); return error;
Error: Error:
remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir); remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment