Commit a6fc6720 authored by Thomas Renninger's avatar Thomas Renninger Committed by Len Brown

ACPI: Enable ACPI error messages w/o CONFIG_ACPI_DEBUG

Signed-off-by: default avatarThomas Renninger <trenn@suse.de>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent eb99adde
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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;
}
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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));
}
......
......@@ -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_device_bid(device)));
return_ACPI_STATUS(AE_NOT_EXIST);
}
status = acpi_get_data(handle, acpi_pci_data_handler, (void **)&data);
if (ACPI_FAILURE(status) || !data) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Invalid ACPI-PCI context for device %s\n",
acpi_device_bid(device)));
ACPI_EXCEPTION((AE_INFO, status,
"Invalid ACPI-PCI context for device %s",
acpi_device_bid(device)));
return_ACPI_STATUS(status);
}
......@@ -151,9 +151,9 @@ int acpi_pci_bind(struct acpi_device *device)
status = acpi_get_data(device->parent->handle, acpi_pci_data_handler,
(void **)&pdata);
if (ACPI_FAILURE(status) || !pdata || !pdata->bus) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Invalid ACPI-PCI context for parent device %s\n",
acpi_device_bid(device->parent)));
ACPI_EXCEPTION((AE_INFO, status,
"Invalid ACPI-PCI context for parent device %s",
acpi_device_bid(device->parent)));
result = -ENODEV;
goto end;
}
......@@ -206,10 +206,10 @@ int acpi_pci_bind(struct acpi_device *device)
goto end;
}
if (!data->dev->bus) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Device %02x:%02x:%02x.%02x has invalid 'bus' field\n",
data->id.segment, data->id.bus,
data->id.device, data->id.function));
ACPI_ERROR((AE_INFO,
"Device %02x:%02x:%02x.%02x has invalid 'bus' field",
data->id.segment, data->id.bus,
data->id.device, data->id.function));
result = -ENODEV;
goto end;
}
......@@ -237,9 +237,9 @@ int acpi_pci_bind(struct acpi_device *device)
*/
status = acpi_attach_data(device->handle, acpi_pci_data_handler, data);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to attach ACPI-PCI context to device %s\n",
acpi_device_bid(device)));
ACPI_EXCEPTION((AE_INFO, status,
"Unable to attach ACPI-PCI context to device %s",
acpi_device_bid(device)));
result = -ENODEV;
goto end;
}
......@@ -301,18 +301,18 @@ int acpi_pci_unbind(struct acpi_device *device)
acpi_get_data(device->handle, acpi_pci_data_handler,
(void **)&data);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to get data from device %s\n",
acpi_device_bid(device)));
ACPI_EXCEPTION((AE_INFO, status,
"Unable to get data from device %s",
acpi_device_bid(device)));
result = -ENODEV;
goto end;
}
status = acpi_detach_data(device->handle, acpi_pci_data_handler);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to detach data from device %s\n",
acpi_device_bid(device)));
ACPI_EXCEPTION((AE_INFO, status,
"Unable to detach data from device %s",
acpi_device_bid(device)));
result = -ENODEV;
goto end;
}
......@@ -369,9 +369,9 @@ acpi_pci_bind_root(struct acpi_device *device,
status = acpi_attach_data(device->handle, acpi_pci_data_handler, data);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to attach ACPI-PCI context to device %s\n",
pathname));
ACPI_EXCEPTION((AE_INFO, status,
"Unable to attach ACPI-PCI context to device %s",
pathname));
result = -ENODEV;
goto end;
}
......
......@@ -197,8 +197,8 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
kfree(pathname);
status = acpi_get_irq_routing_table(handle, &buffer);
if (status != AE_BUFFER_OVERFLOW) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n",
acpi_format_exception(status)));
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]",
acpi_format_exception(status)));
return_VALUE(-ENODEV);
}
......@@ -211,8 +211,8 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
status = acpi_get_irq_routing_table(handle, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n",
acpi_format_exception(status)));
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]",
acpi_format_exception(status)));
kfree(buffer.pointer);
return_VALUE(-ENODEV);
}
......@@ -269,8 +269,8 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
entry->link.index, triggering,
polarity, link);
if (irq < 0) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Invalid IRQ link routing entry\n"));
ACPI_WARNING((AE_INFO,
"Invalid IRQ link routing entry"));
return_VALUE(-1);
}
} else {
......@@ -379,9 +379,8 @@ acpi_pci_irq_derive(struct pci_dev *dev,
}
if (irq < 0) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Unable to derive IRQ for device %s\n",
pci_name(dev)));
ACPI_WARNING((AE_INFO, "Unable to derive IRQ for device %s",
pci_name(dev)));
return_VALUE(-1);
}
......@@ -421,8 +420,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
pin--;
if (!dev->bus) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Invalid (NULL) 'bus' field\n"));
ACPI_ERROR((AE_INFO, "Invalid (NULL) 'bus' field"));
return_VALUE(-ENODEV);
}
......
......@@ -116,17 +116,15 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
{
struct acpi_resource_irq *p = &resource->data.irq;
if (!p || !p->interrupt_count) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Blank IRQ resource\n"));
ACPI_WARNING((AE_INFO, "Blank IRQ resource"));
return_ACPI_STATUS(AE_OK);
}
for (i = 0;
(i < p->interrupt_count
&& i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
if (!p->interrupts[i]) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Invalid IRQ %d\n",
p->interrupts[i]));
ACPI_WARNING((AE_INFO, "Invalid IRQ %d",
p->interrupts[i]));
continue;
}
link->irq.possible[i] = p->interrupts[i];
......@@ -142,17 +140,16 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
struct acpi_resource_extended_irq *p =
&resource->data.extended_irq;
if (!p || !p->interrupt_count) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Blank EXT IRQ resource\n"));
ACPI_WARNING((AE_INFO,
"Blank EXT IRQ resource"));
return_ACPI_STATUS(AE_OK);
}
for (i = 0;
(i < p->interrupt_count
&& i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
if (!p->interrupts[i]) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Invalid IRQ %d\n",
p->interrupts[i]));
ACPI_WARNING((AE_INFO, "Invalid IRQ %d",
p->interrupts[i]));
continue;
}
link->irq.possible[i] = p->interrupts[i];
......@@ -164,8 +161,7 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
break;
}
default:
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Resource is not an IRQ entry\n"));
ACPI_ERROR((AE_INFO, "Resource is not an IRQ entry\n"));
return_ACPI_STATUS(AE_OK);
}
......@@ -184,7 +180,7 @@ static int acpi_pci_link_get_possible(struct acpi_pci_link *link)
status = acpi_walk_resources(link->handle, METHOD_NAME__PRS,
acpi_pci_link_check_possible, link);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRS\n"));
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRS"));
return_VALUE(-ENODEV);
}
......@@ -227,8 +223,8 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
* extended IRQ descriptors must
* return at least 1 IRQ
*/
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Blank EXT IRQ resource\n"));
ACPI_WARNING((AE_INFO,
"Blank EXT IRQ resource"));
return_ACPI_STATUS(AE_OK);
}
*irq = p->interrupts[0];
......@@ -236,7 +232,7 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
}
break;
default:
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Resource %d isn't an IRQ\n", resource->type));
ACPI_ERROR((AE_INFO, "Resource %d isn't an IRQ", resource->type));
case ACPI_RESOURCE_TYPE_END_TAG:
return_ACPI_STATUS(AE_OK);
}
......@@ -268,8 +264,7 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link)
/* Query _STA, set link->device->status */
result = acpi_bus_get_status(link->device);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to read status\n"));
ACPI_ERROR((AE_INFO, "Unable to read status"));
goto end;
}
......@@ -286,13 +281,13 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link)
status = acpi_walk_resources(link->handle, METHOD_NAME__CRS,
acpi_pci_link_check_current, &irq);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _CRS\n"));
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS"));
result = -ENODEV;
goto end;
}
if (acpi_strict && !irq) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "_CRS returned 0\n"));
ACPI_ERROR((AE_INFO, "_CRS returned 0"));
result = -ENODEV;
}
......@@ -362,7 +357,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
/* ignore resource_source, it's optional */
break;
default:
printk("ACPI BUG: resource_type %d\n", link->irq.resource_type);
ACPI_ERROR((AE_INFO, "Invalid Resource_type %d\n", link->irq.resource_type));
result = -EINVAL;
goto end;
......@@ -374,7 +369,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
/* check for total failure */
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n"));
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SRS"));
result = -ENODEV;
goto end;
}
......@@ -382,14 +377,14 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
/* Query _STA, set device->status */
result = acpi_bus_get_status(link->device);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to read status\n"));
ACPI_ERROR((AE_INFO, "Unable to read status"));
goto end;
}
if (!link->device->status.enabled) {
printk(KERN_WARNING PREFIX
"%s [%s] disabled and referenced, BIOS bug.\n",
acpi_device_name(link->device),
acpi_device_bid(link->device));
ACPI_WARNING((AE_INFO,
"%s [%s] disabled and referenced, BIOS bug",
acpi_device_name(link->device),
acpi_device_bid(link->device)));
}
/* Query _CRS, set link->irq.active */
......@@ -407,10 +402,10 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
* policy: when _CRS doesn't return what we just _SRS
* assume _SRS worked and override _CRS value.
*/
printk(KERN_WARNING PREFIX
"%s [%s] BIOS reported IRQ %d, using IRQ %d\n",
acpi_device_name(link->device),
acpi_device_bid(link->device), link->irq.active, irq);
ACPI_WARNING((AE_INFO,
"%s [%s] BIOS reported IRQ %d, using IRQ %d",
acpi_device_name(link->device),
acpi_device_bid(link->device), link->irq.active, irq));
link->irq.active = irq;
}
......@@ -501,8 +496,7 @@ int __init acpi_irq_penalty_init(void)
link = list_entry(node, struct acpi_pci_link, node);
if (!link) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Invalid link context\n"));
ACPI_ERROR((AE_INFO, "Invalid link context"));
continue;
}
......@@ -561,8 +555,8 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
*/
if (i == link->irq.possible_count) {
if (acpi_strict)
printk(KERN_WARNING PREFIX "_CRS %d not found"
" in _PRS\n", link->irq.active);
ACPI_WARNING((AE_INFO, "_CRS %d not found"
" in _PRS", link->irq.active));
link->irq.active = 0;
}
......@@ -589,11 +583,10 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
/* Attempt to enable the link device at this IRQ. */
if (acpi_pci_link_set(link, irq)) {
printk(PREFIX
"Unable to set IRQ for %s [%s] (likely buggy ACPI BIOS).\n"
"Try pci=noacpi or acpi=off\n",
acpi_device_name(link->device),
acpi_device_bid(link->device));
ACPI_ERROR((AE_INFO, "Unable to set IRQ for %s [%s]. "
"Try pci=noacpi or acpi=off",
acpi_device_name(link->device),
acpi_device_bid(link->device)));
return_VALUE(-ENODEV);
} else {
acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING;
......@@ -626,19 +619,19 @@ acpi_pci_link_allocate_irq(acpi_handle handle,
result = acpi_bus_get_device(handle, &device);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n"));
ACPI_ERROR((AE_INFO, "Invalid link device"));
return_VALUE(-1);
}
link = (struct acpi_pci_link *)acpi_driver_data(device);
if (!link) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n"));
ACPI_ERROR((AE_INFO, "Invalid link context"));
return_VALUE(-1);
}
/* TBD: Support multiple index (IRQ) entries per Link Device */
if (index) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid index %d\n", index));
ACPI_ERROR((AE_INFO, "Invalid index %d", index));
return_VALUE(-1);
}
......@@ -650,7 +643,7 @@ acpi_pci_link_allocate_irq(acpi_handle handle,
if (!link->irq.active) {
mutex_unlock(&acpi_link_lock);
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link active IRQ is 0!\n"));
ACPI_ERROR((AE_INFO, "Link active IRQ is 0!"));
return_VALUE(-1);
}
link->refcnt++;
......@@ -682,20 +675,20 @@ int acpi_pci_link_free_irq(acpi_handle handle)
result = acpi_bus_get_device(handle, &device);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n"));
ACPI_ERROR((AE_INFO, "Invalid link device"));
return_VALUE(-1);
}
link = (struct acpi_pci_link *)acpi_driver_data(device);
if (!link) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n"));
ACPI_ERROR((AE_INFO, "Invalid link context"));
return_VALUE(-1);
}
mutex_lock(&acpi_link_lock);
if (!link->irq.initialized) {
mutex_unlock(&acpi_link_lock);
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link isn't initialized\n"));
ACPI_ERROR((AE_INFO, "Link isn't initialized"));
return_VALUE(-1);
}
#ifdef FUTURE_USE
......@@ -820,8 +813,7 @@ static int irqrouter_resume(struct sys_device *dev)
list_for_each(node, &acpi_link.entries) {
link = list_entry(node, struct acpi_pci_link, node);
if (!link) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Invalid link context\n"));
ACPI_ERROR((AE_INFO, "Invalid link context"));
continue;
}
acpi_pci_link_resume(link);
......
......@@ -198,7 +198,7 @@ static int acpi_pci_root_add(struct acpi_device *device)
root->id.segment = 0;
break;
default:
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SEG\n"));
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SEG"));
result = -ENODEV;
goto end;
}
......@@ -219,7 +219,7 @@ static int acpi_pci_root_add(struct acpi_device *device)
root->id.bus = 0;
break;
default:
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BBN\n"));
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BBN"));
result = -ENODEV;
goto end;
}
......@@ -231,8 +231,9 @@ static int acpi_pci_root_add(struct acpi_device *device)
int bus = 0;
acpi_status status;
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Wrong _BBN value, please reboot and using option 'pci=noacpi'\n"));
ACPI_ERROR((AE_INFO,
"Wrong _BBN value, reboot"
" and use option 'pci=noacpi'"));
status = try_get_root_bridge_busnr(root->handle, &bus);
if (ACPI_FAILURE(status))
......@@ -273,9 +274,9 @@ static int acpi_pci_root_add(struct acpi_device *device)
*/
root->bus = pci_acpi_scan_root(device, root->id.segment, root->id.bus);
if (!root->bus) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Bus %04x:%02x not present in PCI namespace\n",
root->id.segment, root->id.bus));
ACPI_ERROR((AE_INFO,
"Bus %04x:%02x not present in PCI namespace",
root->id.segment, root->id.bus));
result = -ENODEV;
goto end;
}
......
......@@ -105,8 +105,7 @@ acpi_power_get_context(acpi_handle handle,
result = acpi_bus_get_device(handle, &device);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error getting context [%p]\n",
handle));
ACPI_WARNING((AE_INFO, "Getting context [%p]", handle));
return_VALUE(result);
}
......@@ -292,8 +291,7 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev)
for (i = 0; i < dev->wakeup.resources.count; i++) {
ret = acpi_power_on(dev->wakeup.resources.handles[i]);
if (ret) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error transition power state\n"));
ACPI_ERROR((AE_INFO, "Transition power state"));
dev->wakeup.flags.valid = 0;
return_VALUE(-1);
}
......@@ -302,7 +300,7 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev)
/* Execute PSW */
status = acpi_evaluate_object(dev->handle, "_PSW", &arg_list, NULL);
if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluate _PSW\n"));
ACPI_ERROR((AE_INFO, "Evaluate _PSW"));
dev->wakeup.flags.valid = 0;
ret = -1;
}
......@@ -332,7 +330,7 @@ int acpi_disable_wakeup_device_power(struct acpi_device *dev)
/* Execute PSW */
status = acpi_evaluate_object(dev->handle, "_PSW", &arg_list, NULL);
if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluate _PSW\n"));
ACPI_ERROR((AE_INFO, "Evaluate _PSW"));
dev->wakeup.flags.valid = 0;
return_VALUE(-1);
}
......@@ -341,8 +339,7 @@ int acpi_disable_wakeup_device_power(struct acpi_device *dev)
for (i = 0; i < dev->wakeup.resources.count; i++) {
ret = acpi_power_off_device(dev->wakeup.resources.handles[i]);
if (ret) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error transition power state\n"));
ACPI_ERROR((AE_INFO, "Transition power state"));
dev->wakeup.flags.valid = 0;
return_VALUE(-1);
}
......@@ -444,9 +441,8 @@ int acpi_power_transition(struct acpi_device *device, int state)
device->power.state = 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));
return_VALUE(result);
}
......@@ -516,9 +512,7 @@ static int acpi_power_add_fs(struct acpi_device *device)
entry = create_proc_entry(ACPI_POWER_FILE_STATUS,
S_IRUGO, acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create '%s' fs entry\n",
ACPI_POWER_FILE_STATUS));
return_VALUE(-EIO);
else {
entry->proc_fops = &acpi_power_fops;
entry->data = acpi_driver_data(device);
......
......@@ -328,9 +328,7 @@ static int acpi_processor_add_fs(struct acpi_device *device)
entry = create_proc_entry(ACPI_PROCESSOR_FILE_INFO,
S_IRUGO, acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create '%s' fs entry\n",
ACPI_PROCESSOR_FILE_INFO));
return_VALUE(-EIO);
else {
entry->proc_fops = &acpi_processor_info_fops;
entry->data = acpi_driver_data(device);
......@@ -342,9 +340,7 @@ static int acpi_processor_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_PROCESSOR_FILE_THROTTLING));
return_VALUE(-EIO);
else {
entry->proc_fops = &acpi_processor_throttling_fops;
entry->data = acpi_driver_data(device);
......@@ -356,9 +352,7 @@ static int acpi_processor_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_PROCESSOR_FILE_LIMIT));
return_VALUE( -EIO);
else {
entry->proc_fops = &acpi_processor_limit_fops;
entry->data = acpi_driver_data(device);
......@@ -459,8 +453,7 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
*/
status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error evaluating processor object\n"));
ACPI_ERROR((AE_INFO, "Evaluating processor object"));
return_VALUE(-ENODEV);
}
......@@ -490,9 +483,9 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
if (cpu_index == -1) {
if (ACPI_FAILURE
(acpi_processor_hotadd_init(pr->handle, &pr->id))) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error getting cpuindex for acpiid 0x%x\n",
pr->acpi_id));
ACPI_ERROR((AE_INFO,
"Getting cpuindex for acpiid 0x%x",
pr->acpi_id));
return_VALUE(-ENODEV);
}
}
......@@ -503,8 +496,8 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
if (!object.processor.pblk_address)
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n"));
else if (object.processor.pblk_length != 6)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid PBLK length [%d]\n",
object.processor.pblk_length));
ACPI_ERROR((AE_INFO, "Invalid PBLK length [%d]",
object.processor.pblk_length));
else {
pr->throttling.address = object.processor.pblk_address;
pr->throttling.duty_offset = acpi_fadt.duty_offset;
......@@ -572,10 +565,6 @@ static int acpi_processor_start(struct acpi_device *device)
status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
acpi_processor_notify, pr);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error installing device notify handler\n"));
}
/* _PDC call should be done before doing anything else (if reqd.). */
arch_acpi_processor_init_pdc(pr);
......@@ -675,10 +664,6 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
status = acpi_remove_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
acpi_processor_notify);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error removing notify handler\n"));
}
acpi_processor_remove_fs(device);
......@@ -705,8 +690,7 @@ static int is_processor_present(acpi_handle handle)
status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
if (ACPI_FAILURE(status) || !(sta & ACPI_STA_PRESENT)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Processor Device is not present\n"));
ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present"));
return_VALUE(0);
}
return_VALUE(1);
......@@ -767,15 +751,14 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
if (acpi_bus_get_device(handle, &device)) {
result = acpi_processor_device_add(handle, &device);
if (result)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to add the device\n"));
ACPI_ERROR((AE_INFO,
"Unable to add the device"));
break;
}
pr = acpi_driver_data(device);
if (!pr) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Driver data is NULL\n"));
ACPI_ERROR((AE_INFO, "Driver data is NULL"));
break;
}
......@@ -788,9 +771,8 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
if ((!result) && ((pr->id >= 0) && (pr->id < NR_CPUS))) {
kobject_uevent(&device->kobj, KOBJ_ONLINE);
} else {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Device [%s] failed to start\n",
acpi_device_bid(device)));
ACPI_ERROR((AE_INFO, "Device [%s] failed to start",
acpi_device_bid(device)));
}
break;
case ACPI_NOTIFY_EJECT_REQUEST:
......@@ -798,14 +780,14 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
"received ACPI_NOTIFY_EJECT_REQUEST\n"));
if (acpi_bus_get_device(handle, &device)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Device don't exist, dropping EJECT\n"));
ACPI_ERROR((AE_INFO,
"Device don't exist, dropping EJECT"));
break;
}
pr = acpi_driver_data(device);
if (!pr) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Driver data is NULL, dropping EJECT\n"));
ACPI_ERROR((AE_INFO,
"Driver data is NULL, dropping EJECT"));
return_VOID;
}
......
......@@ -674,8 +674,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
/* There must be at least 2 elements */
if (!cst || (cst->type != ACPI_TYPE_PACKAGE) || cst->package.count < 2) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"not enough elements in _CST\n"));
ACPI_ERROR((AE_INFO, "not enough elements in _CST"));
status = -EFAULT;
goto end;
}
......@@ -684,8 +683,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
/* Validate number of power states. */
if (count < 1 || count != cst->package.count - 1) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"count given by _CST is not valid\n"));
ACPI_ERROR((AE_INFO, "count given by _CST is not valid"));
status = -EFAULT;
goto end;
}
......@@ -1112,8 +1110,8 @@ int acpi_processor_power_init(struct acpi_processor *pr,
status =
acpi_os_write_port(acpi_fadt.smi_cmd, acpi_fadt.cst_cnt, 8);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Notifying BIOS of _CST ability failed\n"));
ACPI_EXCEPTION((AE_INFO, status,
"Notifying BIOS of _CST ability failed"));
}
}
......@@ -1142,9 +1140,7 @@ int acpi_processor_power_init(struct acpi_processor *pr,
entry = create_proc_entry(ACPI_PROCESSOR_FILE_POWER,
S_IRUGO, acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create '%s' fs entry\n",
ACPI_PROCESSOR_FILE_POWER));
return -EIO;
else {
entry->proc_fops = &acpi_processor_power_fops;
entry->data = acpi_driver_data(device);
......
......@@ -123,7 +123,7 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
acpi_processor_ppc_status |= PPC_IN_USE;
if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PPC\n"));
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PPC"));
return_VALUE(-ENODEV);
}
......@@ -172,14 +172,14 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PCT\n"));
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PCT"));
return_VALUE(-ENODEV);
}
pct = (union acpi_object *)buffer.pointer;
if (!pct || (pct->type != ACPI_TYPE_PACKAGE)
|| (pct->package.count != 2)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PCT data\n"));
ACPI_ERROR((AE_INFO, "Invalid _PCT data"));
result = -EFAULT;
goto end;
}
......@@ -193,8 +193,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
if ((obj.type != ACPI_TYPE_BUFFER)
|| (obj.buffer.length < sizeof(struct acpi_pct_register))
|| (obj.buffer.pointer == NULL)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Invalid _PCT data (control_register)\n"));
ACPI_ERROR((AE_INFO, "Invalid _PCT data (control_register)"));
result = -EFAULT;
goto end;
}
......@@ -210,8 +209,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
if ((obj.type != ACPI_TYPE_BUFFER)
|| (obj.buffer.length < sizeof(struct acpi_pct_register))
|| (obj.buffer.pointer == NULL)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Invalid _PCT data (status_register)\n"));
ACPI_ERROR((AE_INFO, "Invalid _PCT data (status_register)"));
result = -EFAULT;
goto end;
}
......@@ -239,13 +237,13 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PSS\n"));
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PSS"));
return_VALUE(-ENODEV);
}
pss = (union acpi_object *)buffer.pointer;
if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSS data\n"));
ACPI_ERROR((AE_INFO, "Invalid _PSS data"));
result = -EFAULT;
goto end;
}
......@@ -274,8 +272,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
status = acpi_extract_package(&(pss->package.elements[i]),
&format, &state);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Invalid _PSS data\n"));
ACPI_EXCEPTION((AE_INFO, status, "Invalid _PSS data"));
result = -EFAULT;
kfree(pr->performance->states);
goto end;
......@@ -291,8 +288,8 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
(u32) px->control, (u32) px->status));
if (!px->core_frequency) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Invalid _PSS data: freq is zero\n"));
ACPI_ERROR((AE_INFO,
"Invalid _PSS data: freq is zero"));
result = -EFAULT;
kfree(pr->performance->states);
goto end;
......@@ -387,10 +384,10 @@ int acpi_processor_notify_smm(struct module *calling_module)
status = acpi_os_write_port(acpi_fadt.smi_cmd,
(u32) acpi_fadt.pstate_cnt, 8);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Failed to write pstate_cnt [0x%x] to "
"smi_cmd [0x%x]\n", acpi_fadt.pstate_cnt,
acpi_fadt.smi_cmd));
ACPI_EXCEPTION((AE_INFO, status,
"Failed to write pstate_cnt [0x%x] to "
"smi_cmd [0x%x]", acpi_fadt.pstate_cnt,
acpi_fadt.smi_cmd));
module_put(calling_module);
return_VALUE(status);
}
......@@ -514,11 +511,7 @@ static void acpi_cpufreq_add_file(struct acpi_processor *pr)
entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
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_PROCESSOR_FILE_PERFORMANCE));
else {
if (entry){
acpi_processor_perf_fops.write = acpi_processor_write_performance;
entry->proc_fops = &acpi_processor_perf_fops;
entry->data = acpi_driver_data(device);
......
......@@ -82,7 +82,7 @@ static int acpi_processor_apply_limit(struct acpi_processor *pr)
end:
if (result)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to set limit\n"));
ACPI_ERROR((AE_INFO, "Unable to set limit"));
return_VALUE(result);
}
......@@ -289,8 +289,7 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type)
result = acpi_processor_apply_limit(pr);
if (result)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to set thermal limit\n"));
ACPI_ERROR((AE_INFO, "Unable to set thermal limit"));
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Thermal limit now (P%d:T%d)\n",
pr->limit.thermal.px, pr->limit.thermal.tx));
......@@ -362,25 +361,23 @@ static ssize_t acpi_processor_write_limit(struct file * file,
ACPI_FUNCTION_TRACE("acpi_processor_write_limit");
if (!pr || (count > sizeof(limit_string) - 1)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
return_VALUE(-EINVAL);
}
if (copy_from_user(limit_string, buffer, count)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data\n"));
return_VALUE(-EFAULT);
}
limit_string[count] = '\0';
if (sscanf(limit_string, "%d:%d", &px, &tx) != 2) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n"));
ACPI_ERROR((AE_INFO, "Invalid data format"));
return_VALUE(-EINVAL);
}
if (pr->flags.throttling) {
if ((tx < 0) || (tx > (pr->throttling.state_count - 1))) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid tx\n"));
ACPI_ERROR((AE_INFO, "Invalid tx"));
return_VALUE(-EINVAL);
}
pr->limit.user.tx = tx;
......
......@@ -196,7 +196,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
}
/* TBD: Support duty_cycle values that span bit 4. */
else if ((pr->throttling.duty_offset + pr->throttling.duty_width) > 4) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "duty_cycle spans bit 4\n"));
ACPI_WARNING((AE_INFO, "duty_cycle spans bit 4"));
return_VALUE(0);
}
......
......@@ -311,15 +311,14 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
/* _PRW */
status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRW\n"));
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW"));
goto end;
}
package = (union acpi_object *)buffer.pointer;
status = acpi_bus_extract_wakeup_device_power_package(device, package);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error extracting _PRW package\n"));
ACPI_EXCEPTION((AE_INFO, status, "Extracting _PRW package"));
goto end;
}
......@@ -970,7 +969,7 @@ acpi_add_single_object(struct acpi_device **child,
device = kmalloc(sizeof(struct acpi_device), GFP_KERNEL);
if (!device) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Memory allocation error\n"));
ACPI_ERROR((AE_INFO, "Memory allocation error"));
return_VALUE(-ENOMEM);
}
memset(device, 0, sizeof(struct acpi_device));
......
......@@ -161,9 +161,6 @@ static int __init acpi_system_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_FADT, acpi_root_dir);
remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir);
remove_proc_entry(ACPI_SYSTEM_FILE_INFO, acpi_root_dir);
......
......@@ -325,7 +325,7 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
&tz->trips.critical.temperature);
if (ACPI_FAILURE(status)) {
tz->trips.critical.flags.valid = 0;
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No critical threshold\n"));
ACPI_EXCEPTION((AE_INFO, status, "No critical threshold"));
return_VALUE(-ENODEV);
} else {
tz->trips.critical.flags.valid = 1;
......@@ -384,8 +384,7 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
tz->trips.passive.flags.valid = 0;
if (!tz->trips.passive.flags.valid)
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Invalid passive threshold\n"));
ACPI_WARNING((AE_INFO, "Invalid passive threshold"));
else
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Found passive threshold [%lu]\n",
......@@ -414,9 +413,8 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
"Found active threshold [%d]:[%lu]\n",
i, tz->trips.active[i].temperature));
} else
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Invalid active threshold [%d]\n",
i));
ACPI_EXCEPTION((AE_INFO, status,
"Invalid active threshold [%d]", i));
}
return_VALUE(0);
......@@ -471,7 +469,7 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
return_VALUE(-EINVAL);
if (tz->temperature >= tz->trips.critical.temperature) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Critical trip point\n"));
ACPI_WARNING((AE_INFO, "Critical trip point"));
tz->trips.critical.flags.enabled = 1;
} else if (tz->trips.critical.flags.enabled)
tz->trips.critical.flags.enabled = 0;
......@@ -502,7 +500,7 @@ static int acpi_thermal_hot(struct acpi_thermal *tz)
return_VALUE(-EINVAL);
if (tz->temperature >= tz->trips.hot.temperature) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Hot trip point\n"));
ACPI_WARNING((AE_INFO, "Hot trip point"));
tz->trips.hot.flags.enabled = 1;
} else if (tz->trips.hot.flags.enabled)
tz->trips.hot.flags.enabled = 0;
......@@ -642,10 +640,10 @@ static void acpi_thermal_active(struct acpi_thermal *tz)
handles[j],
ACPI_STATE_D0);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Unable to turn cooling device [%p] 'on'\n",
active->devices.
handles[j]));
ACPI_WARNING((AE_INFO,
"Unable to turn cooling device [%p] 'on'",
active->devices.
handles[j]));
continue;
}
active->flags.enabled = 1;
......@@ -667,9 +665,9 @@ static void acpi_thermal_active(struct acpi_thermal *tz)
result = acpi_bus_set_power(active->devices.handles[j],
ACPI_STATE_D3);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Unable to turn cooling device [%p] 'off'\n",
active->devices.handles[j]));
ACPI_WARNING((AE_INFO,
"Unable to turn cooling device [%p] 'off'",
active->devices.handles[j]));
continue;
}
active->flags.enabled = 0;
......@@ -700,7 +698,7 @@ static void acpi_thermal_check(void *data)
ACPI_FUNCTION_TRACE("acpi_thermal_check");
if (!tz) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid (NULL) context.\n"));
ACPI_ERROR((AE_INFO, "Invalid (NULL) context"));
return_VOID;
}
......@@ -949,13 +947,11 @@ acpi_thermal_write_trip_points(struct file *file,
}
if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
count = -EINVAL;
goto end;
}
if (copy_from_user(limit_string, buffer, count)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data\n"));
count = -EFAULT;
goto end;
}
......@@ -968,7 +964,6 @@ acpi_thermal_write_trip_points(struct file *file,
&active[5], &active[6], &active[7], &active[8],
&active[9]);
if (!(num >= 5 && num < (ACPI_THERMAL_MAX_ACTIVE + 3))) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n"));
count = -EINVAL;
goto end;
}
......@@ -1128,9 +1123,7 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
entry = create_proc_entry(ACPI_THERMAL_FILE_STATE,
S_IRUGO, acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create '%s' fs entry\n",
ACPI_THERMAL_FILE_STATE));
return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_thermal_state_fops;
entry->data = acpi_driver_data(device);
......@@ -1141,9 +1134,7 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
entry = create_proc_entry(ACPI_THERMAL_FILE_TEMPERATURE,
S_IRUGO, acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create '%s' fs entry\n",
ACPI_THERMAL_FILE_TEMPERATURE));
return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_thermal_temp_fops;
entry->data = acpi_driver_data(device);
......@@ -1155,9 +1146,7 @@ static int acpi_thermal_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_THERMAL_FILE_TRIP_POINTS));
return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_thermal_trip_fops;
entry->data = acpi_driver_data(device);
......@@ -1169,9 +1158,7 @@ static int acpi_thermal_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_THERMAL_FILE_COOLING_MODE));
return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_thermal_cooling_fops;
entry->data = acpi_driver_data(device);
......@@ -1183,9 +1170,7 @@ static int acpi_thermal_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_THERMAL_FILE_POLLING_FREQ));
return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_thermal_polling_fops;
entry->data = acpi_driver_data(device);
......@@ -1355,8 +1340,6 @@ static int acpi_thermal_add(struct acpi_device *device)
ACPI_DEVICE_NOTIFY,
acpi_thermal_notify, tz);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error installing notify handler\n"));
result = -ENODEV;
goto end;
}
......@@ -1398,9 +1381,6 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
status = acpi_remove_notify_handler(tz->handle,
ACPI_DEVICE_NOTIFY,
acpi_thermal_notify);
if (ACPI_FAILURE(status))
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error removing notify handler\n"));
/* Terminate policy */
if (tz->trips.passive.flags.valid && tz->trips.passive.flags.enabled) {
......
......@@ -62,26 +62,25 @@ acpi_extract_package(union acpi_object *package,
if (!package || (package->type != ACPI_TYPE_PACKAGE)
|| (package->package.count < 1)) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Invalid 'package' argument\n"));
ACPI_WARNING((AE_INFO, "Invalid package argument"));
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
if (!format || !format->pointer || (format->length < 1)) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'format' argument\n"));
ACPI_WARNING((AE_INFO, "Invalid format argument"));
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
if (!buffer) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid 'buffer' argument\n"));
ACPI_WARNING((AE_INFO, "Invalid buffer argument"));
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
format_count = (format->length / sizeof(char)) - 1;
if (format_count > package->package.count) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Format specifies more objects [%d] than exist in package [%d].",
format_count, package->package.count));
ACPI_WARNING((AE_INFO, "Format specifies more objects [%d]"
" than exist in package [%d].",
format_count, package->package.count));
return_ACPI_STATUS(AE_BAD_DATA);
}
......@@ -113,9 +112,10 @@ acpi_extract_package(union acpi_object *package,
tail_offset += sizeof(char *);
break;
default:
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Invalid package element [%d]: got number, expecing [%c].\n",
i, format_string[i]));
ACPI_WARNING((AE_INFO, "Invalid package element"
" [%d]: got number, expecing"
" [%c]",
i, format_string[i]));
return_ACPI_STATUS(AE_BAD_DATA);
break;
}
......@@ -138,9 +138,10 @@ acpi_extract_package(union acpi_object *package,
tail_offset += sizeof(u8 *);
break;
default:
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Invalid package element [%d] got string/buffer, expecing [%c].\n",
i, format_string[i]));
ACPI_WARNING((AE_INFO, "Invalid package element"
" [%d] got string/buffer,"
" expecing [%c]",
i, format_string[i]));
return_ACPI_STATUS(AE_BAD_DATA);
break;
}
......@@ -325,7 +326,7 @@ acpi_evaluate_string(acpi_handle handle,
*data = kmalloc(element->string.length + 1, GFP_KERNEL);
if (!data) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Memory allocation error\n"));
ACPI_ERROR((AE_INFO, "Memory allocation"));
return_VALUE(-ENOMEM);
}
memset(*data, 0, element->string.length + 1);
......@@ -367,25 +368,22 @@ acpi_evaluate_reference(acpi_handle handle,
package = (union acpi_object *)buffer.pointer;
if ((buffer.length == 0) || !package) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"No return object (len %X ptr %p)\n",
(unsigned)buffer.length, package));
ACPI_ERROR((AE_INFO, "No return object (len %X ptr %p)",
(unsigned)buffer.length, package));
status = AE_BAD_DATA;
acpi_util_eval_error(handle, pathname, status);
goto end;
}
if (package->type != ACPI_TYPE_PACKAGE) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Expecting a [Package], found type %X\n",
package->type));
ACPI_ERROR((AE_INFO, "Expecting a [Package], found type %X",
package->type));
status = AE_BAD_DATA;
acpi_util_eval_error(handle, pathname, status);
goto end;
}
if (!package->package.count) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"[Package] has zero elements (%p)\n",
package));
ACPI_ERROR((AE_INFO, "[Package] has zero elements (%p)",
package));
status = AE_BAD_DATA;
acpi_util_eval_error(handle, pathname, status);
goto end;
......@@ -404,9 +402,9 @@ acpi_evaluate_reference(acpi_handle handle,
if (element->type != ACPI_TYPE_ANY) {
status = AE_BAD_DATA;
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Expecting a [Reference] package element, found type %X\n",
element->type));
ACPI_ERROR((AE_INFO,
"Expecting a [Reference] package element, found type %X",
element->type));
acpi_util_eval_error(handle, pathname, status);
break;
}
......
......@@ -324,7 +324,7 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device,
return_VALUE(status);
obj = (union acpi_object *)buffer.pointer;
if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _BCL data\n"));
ACPI_ERROR((AE_INFO, "Invalid _BCL data"));
status = -EFAULT;
goto err;
}
......@@ -399,7 +399,7 @@ acpi_video_device_EDID(struct acpi_video_device *device,
if (obj && obj->type == ACPI_TYPE_BUFFER)
*edid = obj;
else {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _DDC data\n"));
ACPI_ERROR((AE_INFO, "Invalid _DDC data"));
status = -EFAULT;
kfree(obj);
}
......@@ -560,8 +560,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
o = (union acpi_object *)&obj->package.
elements[i];
if (o->type != ACPI_TYPE_INTEGER) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Invalid data\n"));
ACPI_ERROR((AE_INFO, "Invalid data"));
continue;
}
br->levels[count] = (u32) o->integer.value;
......@@ -904,8 +903,7 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
/* 'info' [R] */
entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create 'info' fs entry\n"));
return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_video_device_info_fops;
entry->data = acpi_driver_data(device);
......@@ -917,8 +915,7 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
create_proc_entry("state", S_IFREG | S_IRUGO | S_IWUSR,
acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create 'state' fs entry\n"));
return_VALUE(-ENODEV);
else {
acpi_video_device_state_fops.write = acpi_video_device_write_state;
entry->proc_fops = &acpi_video_device_state_fops;
......@@ -931,8 +928,7 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
create_proc_entry("brightness", S_IFREG | S_IRUGO | S_IWUSR,
acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create 'brightness' fs entry\n"));
return_VALUE(-ENODEV);
else {
acpi_video_device_brightness_fops.write = acpi_video_device_write_brightness;
entry->proc_fops = &acpi_video_device_brightness_fops;
......@@ -943,8 +939,7 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
/* 'EDID' [R] */
entry = create_proc_entry("EDID", S_IRUGO, acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create 'brightness' fs entry\n"));
return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_video_device_EDID_fops;
entry->data = acpi_driver_data(device);
......@@ -1200,8 +1195,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
/* 'info' [R] */
entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create 'info' fs entry\n"));
return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_video_bus_info_fops;
entry->data = acpi_driver_data(device);
......@@ -1211,8 +1205,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
/* 'ROM' [R] */
entry = create_proc_entry("ROM", S_IRUGO, acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create 'ROM' fs entry\n"));
return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_video_bus_ROM_fops;
entry->data = acpi_driver_data(device);
......@@ -1223,8 +1216,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
entry =
create_proc_entry("POST_info", S_IRUGO, acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create 'POST_info' fs entry\n"));
return_VALUE(-ENODEV);
else {
entry->proc_fops = &acpi_video_bus_POST_info_fops;
entry->data = acpi_driver_data(device);
......@@ -1236,8 +1228,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
create_proc_entry("POST", S_IFREG | S_IRUGO | S_IRUSR,
acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create 'POST' fs entry\n"));
return_VALUE(-ENODEV);
else {
acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST;
entry->proc_fops = &acpi_video_bus_POST_fops;
......@@ -1250,8 +1241,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
create_proc_entry("DOS", S_IFREG | S_IRUGO | S_IRUSR,
acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create 'DOS' fs entry\n"));
return_VALUE(-ENODEV);
else {
acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS;
entry->proc_fops = &acpi_video_bus_DOS_fops;
......@@ -1446,13 +1436,13 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
status = acpi_evaluate_object(video->handle, "_DOD", NULL, &buffer);
if (!ACPI_SUCCESS(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _DOD\n"));
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _DOD"));
return_VALUE(status);
}
dod = (union acpi_object *)buffer.pointer;
if (!dod || (dod->type != ACPI_TYPE_PACKAGE)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _DOD data\n"));
ACPI_EXCEPTION((AE_INFO, status, "Invalid _DOD data"));
status = -EFAULT;
goto out;
}
......@@ -1476,8 +1466,7 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
obj = (union acpi_object *)&dod->package.elements[i];
if (obj->type != ACPI_TYPE_INTEGER) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Invalid _DOD data\n"));
ACPI_ERROR((AE_INFO, "Invalid _DOD data"));
active_device_list[i].value.int_val =
ACPI_VIDEO_HEAD_INVALID;
}
......@@ -1591,8 +1580,7 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
status = acpi_video_bus_get_one_device(dev, video);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Cant attach device\n"));
ACPI_EXCEPTION((AE_INFO, status, "Cant attach device"));
continue;
}
......@@ -1620,9 +1608,6 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
status = acpi_remove_notify_handler(device->handle,
ACPI_DEVICE_NOTIFY,
acpi_video_device_notify);
if (ACPI_FAILURE(status))
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error removing notify handler\n"));
return_VALUE(0);
}
......@@ -1826,9 +1811,6 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type)
status = acpi_remove_notify_handler(video->handle,
ACPI_DEVICE_NOTIFY,
acpi_video_bus_notify);
if (ACPI_FAILURE(status))
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error removing notify handler\n"));
acpi_video_bus_put_devices(video);
acpi_video_bus_remove_fs(device);
......
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