aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2006-06-26 23:58:43 -0400
committerLen Brown <len.brown@intel.com>2006-06-26 23:58:43 -0400
commita6fc67202e0224e6c9d1d285cc0b444bce887ed5 (patch)
treecb2d422f65c0ab0a95f452f6bac80e2bfdd547de
parenteb99adde31b7d85c67a5e1c2fa5e098e1056dd79 (diff)
ACPI: Enable ACPI error messages w/o CONFIG_ACPI_DEBUG
Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/acpi/ac.c12
-rw-r--r--drivers/acpi/acpi_memhotplug.c67
-rw-r--r--drivers/acpi/battery.c31
-rw-r--r--drivers/acpi/bus.c22
-rw-r--r--drivers/acpi/button.c18
-rw-r--r--drivers/acpi/container.c2
-rw-r--r--drivers/acpi/debug.c5
-rw-r--r--drivers/acpi/ec.c17
-rw-r--r--drivers/acpi/event.c5
-rw-r--r--drivers/acpi/fan.c7
-rw-r--r--drivers/acpi/hotkey.c38
-rw-r--r--drivers/acpi/osl.c9
-rw-r--r--drivers/acpi/pci_bind.c50
-rw-r--r--drivers/acpi/pci_irq.c20
-rw-r--r--drivers/acpi/pci_link.c90
-rw-r--r--drivers/acpi/pci_root.c15
-rw-r--r--drivers/acpi/power.c22
-rw-r--r--drivers/acpi/processor_core.c56
-rw-r--r--drivers/acpi/processor_idle.c14
-rw-r--r--drivers/acpi/processor_perflib.c37
-rw-r--r--drivers/acpi/processor_thermal.c11
-rw-r--r--drivers/acpi/processor_throttling.c2
-rw-r--r--drivers/acpi/scan.c7
-rw-r--r--drivers/acpi/system.c3
-rw-r--r--drivers/acpi/thermal.c58
-rw-r--r--drivers/acpi/utils.c50
-rw-r--r--drivers/acpi/video.c50
27 files changed, 273 insertions, 445 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 7839b831df9..95223d8c5ec 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -91,8 +91,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state);
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error reading AC Adapter state\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state"));
ac->state = ACPI_AC_STATUS_UNKNOWN;
return_VALUE(-ENODEV);
}
@@ -159,9 +158,7 @@ static int acpi_ac_add_fs(struct acpi_device *device)
entry = create_proc_entry(ACPI_AC_FILE_STATE,
S_IRUGO, acpi_device_dir(device));
if (!entry)
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Unable to create '%s' fs entry\n",
- ACPI_AC_FILE_STATE));
+ return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_ac_fops;
entry->data = acpi_driver_data(device);
@@ -249,8 +246,6 @@ static int acpi_ac_add(struct acpi_device *device)
ACPI_DEVICE_NOTIFY, acpi_ac_notify,
ac);
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error installing notify handler\n"));
result = -ENODEV;
goto end;
}
@@ -282,9 +277,6 @@ static int acpi_ac_remove(struct acpi_device *device, int type)
status = acpi_remove_notify_handler(ac->handle,
ACPI_DEVICE_NOTIFY, acpi_ac_notify);
- if (ACPI_FAILURE(status))
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error removing notify handler\n"));
acpi_ac_remove_fs(device);
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index e0a95ba7237..e49d327ccf4 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -125,15 +125,14 @@ acpi_memory_get_device(acpi_handle handle,
status = acpi_get_parent(handle, &phandle);
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_get_parent\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "Cannot find acpi parent"));
return_VALUE(-EINVAL);
}
/* Get the parent device */
status = acpi_bus_get_device(phandle, &pdevice);
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error in acpi_bus_get_device\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "Cannot get acpi bus device"));
return_VALUE(-EINVAL);
}
@@ -143,7 +142,7 @@ acpi_memory_get_device(acpi_handle handle,
*/
status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_bus_add\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "Cannot add acpi bus"));
return_VALUE(-EINVAL);
}
@@ -188,8 +187,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
/* Get the range from the _CRS */
result = acpi_memory_get_device_resources(mem_device);
if (result) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "\nget_device_resources failed\n"));
+ ACPI_ERROR((AE_INFO, "get_device_resources failed"));
mem_device->state = MEMORY_INVALID_STATE;
return result;
}
@@ -200,7 +198,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
*/
result = add_memory(mem_device->start_addr, mem_device->length);
if (result) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "\nadd_memory failed\n"));
+ ACPI_ERROR((AE_INFO, "add_memory failed"));
mem_device->state = MEMORY_INVALID_STATE;
return result;
}
@@ -226,7 +224,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
"_EJ0", &arg_list, NULL);
/* Return on _EJ0 failure */
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "_EJ0 failed.\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "_EJ0 failed"));
return_VALUE(-ENODEV);
}
@@ -256,16 +254,12 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
* Note: Assume that this function returns zero on success
*/
result = remove_memory(start, len);
- if (result) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Hot-Remove failed.\n"));
+ if (result)
return_VALUE(result);
- }
/* Power-off and eject the device */
result = acpi_memory_powerdown_device(mem_device);
if (result) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Device Power Down failed.\n"));
/* Set the status of the device to invalid */
mem_device->state = MEMORY_INVALID_STATE;
return result;
@@ -292,15 +286,14 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"\nReceived DEVICE CHECK notification for device\n"));
if (acpi_memory_get_device(handle, &mem_device)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error in finding driver data\n"));
+ ACPI_ERROR((AE_INFO, "Cannot find driver data"));
return_VOID;
}
if (!acpi_memory_check_device(mem_device)) {
if (acpi_memory_enable_device(mem_device))
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error in acpi_memory_enable_device\n"));
+ ACPI_ERROR((AE_INFO,
+ "Cannot enable memory device"));
}
break;
case ACPI_NOTIFY_EJECT_REQUEST:
@@ -308,14 +301,12 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
"\nReceived EJECT REQUEST notification for device\n"));
if (acpi_bus_get_device(handle, &device)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Device doesn't exist\n"));
+ ACPI_ERROR((AE_INFO, "Device doesn't exist"));
break;
}
mem_device = acpi_driver_data(device);
if (!mem_device) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Driver Data is NULL\n"));
+ ACPI_ERROR((AE_INFO, "Driver Data is NULL"));
break;
}
@@ -326,8 +317,8 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
* with generic sysfs driver
*/
if (acpi_memory_disable_device(mem_device))
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error in acpi_memory_disable_device\n"));
+ ACPI_ERROR((AE_INFO,
+ "Disable memory device\n"));
/*
* TBD: Invoke acpi_bus_remove to cleanup data structures
*/
@@ -405,7 +396,7 @@ static acpi_status is_memory_device(acpi_handle handle)
status = acpi_get_object_info(handle, &buffer);
if (ACPI_FAILURE(status))
- return_ACPI_STATUS(AE_ERROR);
+ return_ACPI_STATUS(status);
info = buffer.pointer;
if (!(info->valid & ACPI_VALID_HID)) {
@@ -431,18 +422,15 @@ acpi_memory_register_notify_handler(acpi_handle handle,
ACPI_FUNCTION_TRACE("acpi_memory_register_notify_handler");
status = is_memory_device(handle);
- if (ACPI_FAILURE(status))
+ if (ACPI_FAILURE(status)){
+ ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
return_ACPI_STATUS(AE_OK); /* continue */
+ }
status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
acpi_memory_device_notify, NULL);
- if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error installing notify handler\n"));
- return_ACPI_STATUS(AE_OK); /* continue */
- }
-
- return_ACPI_STATUS(status);
+ /* continue */
+ return_ACPI_STATUS(AE_OK);
}
static acpi_status
@@ -454,19 +442,16 @@ acpi_memory_deregister_notify_handler(acpi_handle handle,
ACPI_FUNCTION_TRACE("acpi_memory_deregister_notify_handler");
status = is_memory_device(handle);
- if (ACPI_FAILURE(status))
+ if (ACPI_FAILURE(status)){
+ ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
return_ACPI_STATUS(AE_OK); /* continue */
+ }
status = acpi_remove_notify_handler(handle,
ACPI_SYSTEM_NOTIFY,
acpi_memory_device_notify);
- if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error removing notify handler\n"));
- return_ACPI_STATUS(AE_OK); /* continue */
- }
- return_ACPI_STATUS(status);
+ return_ACPI_STATUS(AE_OK); /* continue */
}
static int __init acpi_memory_device_init(void)
@@ -487,7 +472,7 @@ static int __init acpi_memory_device_init(void)
NULL, NULL);
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "walk_namespace failed"));
acpi_bus_unregister_driver(&acpi_memory_device_driver);
return_VALUE(-ENODEV);
}
@@ -511,7 +496,7 @@ static void __exit acpi_memory_device_exit(void)
NULL, NULL);
if (ACPI_FAILURE(status))
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "walk_namespace failed"));
acpi_bus_unregister_driver(&acpi_memory_device_driver);
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 702e857e98c..3b92c94ebc6 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -141,7 +141,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer);
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BIF\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF"));
return_VALUE(-ENODEV);
}
@@ -151,7 +151,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
status = acpi_extract_package(package, &format, &data);
if (status != AE_BUFFER_OVERFLOW) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "Extracting _BIF"));
result = -ENODEV;
goto end;
}
@@ -165,7 +165,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
status = acpi_extract_package(package, &format, &data);
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "Extracting _BIF"));
kfree(data.pointer);
result = -ENODEV;
goto end;
@@ -202,7 +202,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer);
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BST\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST"));
return_VALUE(-ENODEV);
}
@@ -212,7 +212,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
status = acpi_extract_package(package, &format, &data);
if (status != AE_BUFFER_OVERFLOW) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "Extracting _BST"));
result = -ENODEV;
goto end;
}
@@ -226,7 +226,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
status = acpi_extract_package(package, &format, &data);
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "Extracting _BST"));
kfree(data.pointer);
result = -ENODEV;
goto end;
@@ -458,8 +458,6 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
if ((bst->state & 0x01) && (bst->state & 0x02)) {
seq_printf(seq,
"charging state: charging/discharging\n");
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Battery Charging and Discharging?\n"));
} else if (bst->state & 0x01)
seq_printf(seq, "charging state: discharging\n");
else if (bst->state & 0x02)
@@ -609,9 +607,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
entry = create_proc_entry(ACPI_BATTERY_FILE_INFO,
S_IRUGO, acpi_device_dir(device));
if (!entry)
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Unable to create '%s' fs entry\n",
- ACPI_BATTERY_FILE_INFO));
+ return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_battery_info_ops;
entry->data = acpi_driver_data(device);
@@ -622,9 +618,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS,
S_IRUGO, acpi_device_dir(device));
if (!entry)
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Unable to create '%s' fs entry\n",
- ACPI_BATTERY_FILE_STATUS));
+ return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_battery_state_ops;
entry->data = acpi_driver_data(device);
@@ -636,9 +630,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
S_IFREG | S_IRUGO | S_IWUSR,
acpi_device_dir(device));
if (!entry)
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Unable to create '%s' fs entry\n",
- ACPI_BATTERY_FILE_ALARM));
+ return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_battery_alarm_ops;
entry->data = acpi_driver_data(device);
@@ -732,8 +724,6 @@ static int acpi_battery_add(struct acpi_device *device)
ACPI_DEVICE_NOTIFY,
acpi_battery_notify, battery);
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error installing notify handler\n"));
result = -ENODEV;
goto end;
}
@@ -766,9 +756,6 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
status = acpi_remove_notify_handler(battery->handle,
ACPI_DEVICE_NOTIFY,
acpi_battery_notify);
- if (ACPI_FAILURE(status))
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error removing notify handler\n"));
acpi_battery_remove_fs(device);
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index dd3983cece9..917bf2397b2 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -69,8 +69,7 @@ int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device);
if (ACPI_FAILURE(status) || !*device) {
- ACPI_DEBUG_PRINT((ACPI_DB_WARN, "No context for object [%p]\n",
- handle));
+ ACPI_EXCEPTION((AE_INFO, status, "No context for object [%p]", handle));
return_VALUE(-ENODEV);
}
@@ -197,8 +196,7 @@ int acpi_bus_set_power(acpi_handle handle, int state)
/* Make sure this is a valid target state */
if (!device->flags.power_manageable) {
- ACPI_DEBUG_PRINT((ACPI_DB_WARN,
- "Device is not power manageable\n"));
+ ACPI_INFO((AE_INFO, "Device is not power manageable"));
return_VALUE(-ENODEV);
}
/*
@@ -215,13 +213,13 @@ int acpi_bus_set_power(acpi_handle handle, int state)
}
}
if (!device->power.states[state].flags.valid) {
- ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Device does not support D%d\n",
- state));
+ ACPI_WARNING((AE_INFO, "Device does not support D%d", state));
return_VALUE(-ENODEV);
}
if (device->parent && (state < device->parent->power.state)) {
- ACPI_DEBUG_PRINT((ACPI_DB_WARN,
- "Cannot set device to a higher-powered state than parent\n"));
+ ACPI_WARNING((AE_INFO,
+ "Cannot set device to a higher-powered"
+ " state than parent"));
return_VALUE(-ENODEV);
}
@@ -264,9 +262,9 @@ int acpi_bus_set_power(acpi_handle handle, int state)
end:
if (result)
- ACPI_DEBUG_PRINT((ACPI_DB_WARN,
- "Error transitioning device [%s] to D%d\n",
- device->pnp.bus_id, state));
+ ACPI_WARNING((AE_INFO,
+ "Transitioning device [%s] to D%d",
+ device->pnp.bus_id, state));
else
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Device [%s] transitioned to D%d\n",
@@ -581,7 +579,7 @@ static int __init acpi_bus_init_irq(void)
status = acpi_evaluate_object(NULL, "\\_PIC", &arg_list, NULL);
if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PIC\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PIC"));
return_VALUE(-ENODEV);
}
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 4b6d9f0096a..a8717da32a7 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -207,9 +207,7 @@ static int acpi_button_add_fs(struct acpi_device *device)
entry = create_proc_entry(ACPI_BUTTON_FILE_INFO,
S_IRUGO, acpi_device_dir(device));
if (!entry)
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Unable to create '%s' fs entry\n",
- ACPI_BUTTON_FILE_INFO));
+ return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_button_info_fops;
entry->data = acpi_driver_data(device);
@@ -221,9 +219,7 @@ static int acpi_button_add_fs(struct acpi_device *device)
entry = create_proc_entry(ACPI_BUTTON_FILE_STATE,
S_IRUGO, acpi_device_dir(device));
if (!entry)
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Unable to create '%s' fs entry\n",
- ACPI_BUTTON_FILE_INFO));
+ return -ENODEV;
else {
entry->proc_fops = &acpi_button_state_fops;
entry->data = acpi_driver_data(device);
@@ -349,8 +345,8 @@ static int acpi_button_add(struct acpi_device *device)
sprintf(acpi_device_class(device), "%s/%s",
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID);
} else {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unsupported hid [%s]\n",
- acpi_device_hid(device)));
+ ACPI_ERROR((AE_INFO, "Unsupported hid [%s]",
+ acpi_device_hid(device)));
result = -ENODEV;
goto end;
}
@@ -381,8 +377,6 @@ static int acpi_button_add(struct acpi_device *device)
}
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error installing notify handler\n"));
result = -ENODEV;
goto end;
}
@@ -440,10 +434,6 @@ static int acpi_button_remove(struct acpi_device *device, int type)
break;
}
- if (ACPI_FAILURE(status))
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error removing notify handler\n"));
-
acpi_button_remove_fs(device);
kfree(button);
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index b69a8cad82b..53625fc3d71 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -94,7 +94,7 @@ static int acpi_container_add(struct acpi_device *device)
ACPI_FUNCTION_TRACE("acpi_container_add");
if (!device) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "device is NULL\n"));
+ ACPI_ERROR((AE_INFO, "device is NULL"));
return_VALUE(-EINVAL);
}
diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c
index 263322b7d11..ec7bcee7708 100644
--- a/drivers/acpi/debug.c
+++ b/drivers/acpi/debug.c
@@ -216,12 +216,9 @@ static int __init acpi_debug_init(void)
return_VALUE(error);
Error:
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Unable to create '%s' proc fs entry\n", name));
-
remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL, acpi_root_dir);
remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, acpi_root_dir);
- error = -EFAULT;
+ error = -ENODEV;
goto Done;
}
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 18b3ea9dace..94cc8ab9400 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -279,7 +279,7 @@ int acpi_ec_enter_burst_mode(union acpi_ec *ec)
atomic_set(&ec->intr.leaving_burst, 0);
return_VALUE(0);
end:
- printk(KERN_WARNING PREFIX "Error in acpi_ec_wait\n");
+ ACPI_EXCEPTION ((AE_INFO, status, "EC wait, burst mode");
return_VALUE(-1);
}
@@ -300,7 +300,7 @@ int acpi_ec_leave_burst_mode(union acpi_ec *ec)
atomic_set(&ec->intr.leaving_burst, 1);
return_VALUE(0);
end:
- printk(KERN_WARNING PREFIX "leave burst_mode:error\n");
+ ACPI_EXCEPTION((AE_INFO, status, "EC leave burst mode");
return_VALUE(-1);
}
#endif /* ACPI_FUTURE_USAGE */
@@ -963,9 +963,7 @@ static int acpi_ec_add_fs(struct acpi_device *device)
entry = create_proc_entry(ACPI_EC_FILE_INFO, S_IRUGO,
acpi_device_dir(device));
if (!entry)
- ACPI_DEBUG_PRINT((ACPI_DB_WARN,
- "Unable to create '%s' fs entry\n",
- ACPI_EC_FILE_INFO));
+ return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_ec_info_ops;
entry->data = acpi_driver_data(device);
@@ -1038,8 +1036,7 @@ static int acpi_ec_poll_add(struct acpi_device *device)
acpi_evaluate_integer(ec->common.handle, "_GPE", NULL,
&ec->common.gpe_bit);
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error obtaining GPE bit assignment\n"));
+ ACPI_EXCEPTION((AE_INFO, status, "Obtaining GPE bit"));
result = -ENODEV;
goto end;
}
@@ -1110,8 +1107,7 @@ static int acpi_ec_intr_add(struct acpi_device *device)
acpi_evaluate_integer(ec->common.handle, "_GPE", NULL,
&ec->common.gpe_bit);
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error obtaining GPE bit assignment\n"));
+ ACPI_ERROR((AE_INFO, "Obtaining GPE bit assignment"));
result = -ENODEV;
goto end;
}
@@ -1205,8 +1201,7 @@ static int acpi_ec_start(struct acpi_device *device)
acpi_ec_io_ports, ec);
if (ACPI_FAILURE(status)
|| ec->common.command_addr.register_bit_width == 0) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error getting I/O port addresses"));
+ ACPI_ERROR((AE_INFO, "Error getting I/O port addresses"));
return_VALUE(-ENODEV);
}
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index 2dbb1b0f11d..dab09d3f630 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -122,10 +122,7 @@ static int __init acpi_event_init(void)
if (entry)
entry->proc_fops = &acpi_system_event_ops;
else {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Unable to create '%s' proc fs entry\n",
- "event"));
- error = -EFAULT;
+ error = -ENODEV;
}
return_VALUE(error);
}
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 1cd25784b7a..c1d470557b9 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -153,9 +153,7 @@ static int acpi_fan_add_fs(struct acpi_device *device)
S_IFREG | S_IRUGO | S_IWUSR,
acpi_device_dir(device));
if (!entry)
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Unable to create '%s' fs entry\n",
- ACPI_FAN_FILE_STATE));
+ return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_fan_state_ops;
entry->data = acpi_driver_data(device);
@@ -205,8 +203,7 @@ static int acpi_fan_add(struct acpi_device *device)
result = acpi_bus_get_power(fan->handle, &state);
if (result) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error reading power state\n"));
+ ACPI_ERROR((AE_INFO, "Reading power state"));
goto end;
}
diff --git a/drivers/acpi/hotkey.c b/drivers/acpi/hotkey.c
index c25b2b92edc..37dcb1f7f98 100644
--- a/drivers/acpi/hotkey.c
+++ b/drivers/acpi/hotkey.c
@@ -356,9 +356,6 @@ static int create_polling_proc(union acpi_hotkey *device)
proc = create_proc_entry(proc_name, mode, hotkey_proc_dir);
if (!proc) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Hotkey: Unable to create %s entry\n",
- device->poll_hotkey.poll_method));
return_VALUE(-ENODEV);
} else {
proc->proc_fops = &hotkey_polling_fops;
@@ -771,7 +768,7 @@ static ssize_t hotkey_write_config(struct file *file,
if (copy_from_user(config_record, buffer, count)) {
kfree(config_record);
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data \n"));
+ ACPI_ERROR((AE_INFO, "Invalid data"));
return_VALUE(-EINVAL);
}
config_record[count] = 0;
@@ -792,8 +789,7 @@ static ssize_t hotkey_write_config(struct file *file,
kfree(bus_method);
kfree(action_handle);
kfree(method);
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Invalid data format ret=%d\n", ret));
+ ACPI_ERROR((AE_INFO, "Invalid data format ret=%d", ret));
return_VALUE(-EINVAL);
}
@@ -806,7 +802,7 @@ static ssize_t hotkey_write_config(struct file *file,
tmp = get_hotkey_by_event(&global_hotkey_list,
internal_event_num);
if (!tmp)
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid key"));
+ ACPI_ERROR((AE_INFO, "Invalid key"));
else
memcpy(key, tmp, sizeof(union acpi_hotkey));
goto cont_cmd;
@@ -828,7 +824,7 @@ static ssize_t hotkey_write_config(struct file *file,
else
free_poll_hotkey_buffer(key);
kfree(key);
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid hotkey \n"));
+ ACPI_ERROR((AE_INFO, "Invalid hotkey"));
return_VALUE(-EINVAL);
}
@@ -862,7 +858,7 @@ static ssize_t hotkey_write_config(struct file *file,
else
free_poll_hotkey_buffer(key);
kfree(key);
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "invalid key\n"));
+ ACPI_ERROR((AE_INFO, "invalid key"));
return_VALUE(-EINVAL);
}
@@ -907,7 +903,7 @@ static int read_acpi_int(acpi_handle handle, const char *method,
val->integer.value = out_obj.integer.value;
val->type = out_obj.type;
} else
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "null val pointer"));
+ ACPI_ERROR((AE_INFO, "null val pointer"));
return_VALUE((status == AE_OK)
&& (out_obj.type == ACPI_TYPE_INTEGER));
}
@@ -954,14 +950,14 @@ static ssize_t hotkey_execute_aml_method(struct file *file,
if (copy_from_user(arg, buffer, count)) {
kfree(arg);
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 2"));
+ ACPI_ERROR((AE_INFO, "Invalid argument 2"));
return_VALUE(-EINVAL);
}
if (sscanf(arg, "%d:%d:%d:%d", &event, &method_type, &type, &value) !=
4) {
kfree(arg);
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 3"));
+ ACPI_ERROR((AE_INFO, "Invalid argument 3"));
return_VALUE(-EINVAL);
}
kfree(arg);
@@ -987,7 +983,7 @@ static ssize_t hotkey_execute_aml_method(struct file *file,
}
} else {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Not supported"));
+ ACPI_WARNING((AE_INFO, "Not supported"));
return_VALUE(-EINVAL);
}
return_VALUE(count);
@@ -1013,9 +1009,6 @@ static int __init hotkey_init(void)
hotkey_proc_dir = proc_mkdir(HOTKEY_PROC, acpi_root_dir);
if (!hotkey_proc_dir) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Hotkey: Unable to create %s entry\n",
- HOTKEY_PROC));
return (-ENODEV);
}
hotkey_proc_dir->owner = THIS_MODULE;
@@ -1023,9 +1016,6 @@ static int __init hotkey_init(void)
hotkey_config =
create_proc_entry(HOTKEY_EV_CONFIG, mode, hotkey_proc_dir);
if (!hotkey_config) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Hotkey: Unable to create %s entry\n",
- HOTKEY_EV_CONFIG));
goto do_fail1;
} else {
hotkey_config->proc_fops = &hotkey_config_fops;
@@ -1038,10 +1028,6 @@ static int __init hotkey_init(void)
hotkey_poll_config =
create_proc_entry(HOTKEY_PL_CONFIG, mode, hotkey_proc_dir);
if (!hotkey_poll_config) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Hotkey: Unable to create %s entry\n",
- HOTKEY_EV_CONFIG));
-
goto do_fail2;
} else {
hotkey_poll_config->proc_fops = &hotkey_poll_config_fops;
@@ -1053,9 +1039,6 @@ static int __init hotkey_init(void)
hotkey_action = create_proc_entry(HOTKEY_ACTION, mode, hotkey_proc_dir);
if (!hotkey_action) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Hotkey: Unable to create %s entry\n",
- HOTKEY_ACTION));
goto do_fail3;
} else {
hotkey_action->proc_fops = &hotkey_action_fops;
@@ -1066,9 +1049,6 @@ static int __init hotkey_init(void)
hotkey_info = create_proc_entry(HOTKEY_INFO, mode, hotkey_proc_dir);
if (!hotkey_info) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Hotkey: Unable to create %s entry\n",
- HOTKEY_INFO));
goto do_fail4;
} else {
hotkey_info->proc_fops = &hotkey_info_fops;
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 1bb558adee6..740a3c41489 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -137,6 +137,7 @@ void acpi_os_vprintf(const char *fmt, va_list args)
#endif
}
+
extern int acpi_in_resume;
void *acpi_os_allocate(acpi_size size)
{
@@ -590,7 +591,7 @@ static void acpi_os_execute_deferred(void *context)
dpc = (struct acpi_os_dpc *)context;
if (!dpc) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid (NULL) context.\n"));
+ ACPI_ERROR((AE_INFO, "Invalid (NULL) context"));
return_VOID;
}
@@ -839,13 +840,13 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
}
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Failed to acquire semaphore[%p|%d|%d], %s\n",
+ ACPI_EXCEPTION((AE_INFO, status,
+ "Failed to acquire semaphore[%p|%d|%d], %s",
handle, units, timeout,
acpi_format_exception(status)));
} else {
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
- "Acquired semaphore[%p|%d|%d]\n", handle,
+ "Acquired semaphore[%p|%d|%d]", handle,
units, timeout));
}
diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c
index 2a718df769b..6d3e818e327 100644
--- a/drivers/acpi/pci_bind.c
+++ b/drivers/acpi/pci_bind.c
@@ -75,17 +75,17 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id)
result = acpi_bus_get_device(handle, &device);
if (result) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Invalid ACPI Bus context for device %s\n",
- acpi_device_bid(device)));
+ ACPI_ERROR((AE_INFO,
+ "Invalid ACPI Bus context for device %s",
+ acpi_d