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>
This commit is contained in:
parent
eb99adde31
commit
a6fc67202e
27 changed files with 274 additions and 446 deletions
|
@ -91,8 +91,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
|
||||||
|
|
||||||
status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state);
|
status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state"));
|
||||||
"Error reading AC Adapter state\n"));
|
|
||||||
ac->state = ACPI_AC_STATUS_UNKNOWN;
|
ac->state = ACPI_AC_STATUS_UNKNOWN;
|
||||||
return_VALUE(-ENODEV);
|
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,
|
entry = create_proc_entry(ACPI_AC_FILE_STATE,
|
||||||
S_IRUGO, acpi_device_dir(device));
|
S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_AC_FILE_STATE));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_ac_fops;
|
entry->proc_fops = &acpi_ac_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
entry->data = acpi_driver_data(device);
|
||||||
|
@ -249,8 +246,6 @@ static int acpi_ac_add(struct acpi_device *device)
|
||||||
ACPI_DEVICE_NOTIFY, acpi_ac_notify,
|
ACPI_DEVICE_NOTIFY, acpi_ac_notify,
|
||||||
ac);
|
ac);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Error installing notify handler\n"));
|
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -282,9 +277,6 @@ static int acpi_ac_remove(struct acpi_device *device, int type)
|
||||||
|
|
||||||
status = acpi_remove_notify_handler(ac->handle,
|
status = acpi_remove_notify_handler(ac->handle,
|
||||||
ACPI_DEVICE_NOTIFY, acpi_ac_notify);
|
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);
|
acpi_ac_remove_fs(device);
|
||||||
|
|
||||||
|
|
|
@ -125,15 +125,14 @@ acpi_memory_get_device(acpi_handle handle,
|
||||||
|
|
||||||
status = acpi_get_parent(handle, &phandle);
|
status = acpi_get_parent(handle, &phandle);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_get_parent\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Cannot find acpi parent"));
|
||||||
return_VALUE(-EINVAL);
|
return_VALUE(-EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the parent device */
|
/* Get the parent device */
|
||||||
status = acpi_bus_get_device(phandle, &pdevice);
|
status = acpi_bus_get_device(phandle, &pdevice);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status, "Cannot get acpi bus device"));
|
||||||
"Error in acpi_bus_get_device\n"));
|
|
||||||
return_VALUE(-EINVAL);
|
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);
|
status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
|
||||||
if (ACPI_FAILURE(status)) {
|
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);
|
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 */
|
/* Get the range from the _CRS */
|
||||||
result = acpi_memory_get_device_resources(mem_device);
|
result = acpi_memory_get_device_resources(mem_device);
|
||||||
if (result) {
|
if (result) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "get_device_resources failed"));
|
||||||
"\nget_device_resources failed\n"));
|
|
||||||
mem_device->state = MEMORY_INVALID_STATE;
|
mem_device->state = MEMORY_INVALID_STATE;
|
||||||
return result;
|
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);
|
result = add_memory(mem_device->start_addr, mem_device->length);
|
||||||
if (result) {
|
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;
|
mem_device->state = MEMORY_INVALID_STATE;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -226,7 +224,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
|
||||||
"_EJ0", &arg_list, NULL);
|
"_EJ0", &arg_list, NULL);
|
||||||
/* Return on _EJ0 failure */
|
/* Return on _EJ0 failure */
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "_EJ0 failed.\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "_EJ0 failed"));
|
||||||
return_VALUE(-ENODEV);
|
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
|
* Note: Assume that this function returns zero on success
|
||||||
*/
|
*/
|
||||||
result = remove_memory(start, len);
|
result = remove_memory(start, len);
|
||||||
if (result) {
|
if (result)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Hot-Remove failed.\n"));
|
|
||||||
return_VALUE(result);
|
return_VALUE(result);
|
||||||
}
|
|
||||||
|
|
||||||
/* Power-off and eject the device */
|
/* Power-off and eject the device */
|
||||||
result = acpi_memory_powerdown_device(mem_device);
|
result = acpi_memory_powerdown_device(mem_device);
|
||||||
if (result) {
|
if (result) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Device Power Down failed.\n"));
|
|
||||||
/* Set the status of the device to invalid */
|
/* Set the status of the device to invalid */
|
||||||
mem_device->state = MEMORY_INVALID_STATE;
|
mem_device->state = MEMORY_INVALID_STATE;
|
||||||
return result;
|
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,
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||||
"\nReceived DEVICE CHECK notification for device\n"));
|
"\nReceived DEVICE CHECK notification for device\n"));
|
||||||
if (acpi_memory_get_device(handle, &mem_device)) {
|
if (acpi_memory_get_device(handle, &mem_device)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Cannot find driver data"));
|
||||||
"Error in finding driver data\n"));
|
|
||||||
return_VOID;
|
return_VOID;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!acpi_memory_check_device(mem_device)) {
|
if (!acpi_memory_check_device(mem_device)) {
|
||||||
if (acpi_memory_enable_device(mem_device))
|
if (acpi_memory_enable_device(mem_device))
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO,
|
||||||
"Error in acpi_memory_enable_device\n"));
|
"Cannot enable memory device"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACPI_NOTIFY_EJECT_REQUEST:
|
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"));
|
"\nReceived EJECT REQUEST notification for device\n"));
|
||||||
|
|
||||||
if (acpi_bus_get_device(handle, &device)) {
|
if (acpi_bus_get_device(handle, &device)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Device doesn't exist"));
|
||||||
"Device doesn't exist\n"));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mem_device = acpi_driver_data(device);
|
mem_device = acpi_driver_data(device);
|
||||||
if (!mem_device) {
|
if (!mem_device) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Driver Data is NULL"));
|
||||||
"Driver Data is NULL\n"));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,8 +317,8 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
|
||||||
* with generic sysfs driver
|
* with generic sysfs driver
|
||||||
*/
|
*/
|
||||||
if (acpi_memory_disable_device(mem_device))
|
if (acpi_memory_disable_device(mem_device))
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO,
|
||||||
"Error in acpi_memory_disable_device\n"));
|
"Disable memory device\n"));
|
||||||
/*
|
/*
|
||||||
* TBD: Invoke acpi_bus_remove to cleanup data structures
|
* 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);
|
status = acpi_get_object_info(handle, &buffer);
|
||||||
if (ACPI_FAILURE(status))
|
if (ACPI_FAILURE(status))
|
||||||
return_ACPI_STATUS(AE_ERROR);
|
return_ACPI_STATUS(status);
|
||||||
|
|
||||||
info = buffer.pointer;
|
info = buffer.pointer;
|
||||||
if (!(info->valid & ACPI_VALID_HID)) {
|
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");
|
ACPI_FUNCTION_TRACE("acpi_memory_register_notify_handler");
|
||||||
|
|
||||||
status = is_memory_device(handle);
|
status = is_memory_device(handle);
|
||||||
if (ACPI_FAILURE(status))
|
|
||||||
return_ACPI_STATUS(AE_OK); /* continue */
|
|
||||||
|
|
||||||
status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
|
|
||||||
acpi_memory_device_notify, NULL);
|
|
||||||
if (ACPI_FAILURE(status)){
|
if (ACPI_FAILURE(status)){
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
|
||||||
"Error installing notify handler\n"));
|
|
||||||
return_ACPI_STATUS(AE_OK); /* continue */
|
return_ACPI_STATUS(AE_OK); /* continue */
|
||||||
}
|
}
|
||||||
|
|
||||||
return_ACPI_STATUS(status);
|
status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
|
||||||
|
acpi_memory_device_notify, NULL);
|
||||||
|
/* continue */
|
||||||
|
return_ACPI_STATUS(AE_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
static acpi_status
|
static acpi_status
|
||||||
|
@ -454,19 +442,16 @@ acpi_memory_deregister_notify_handler(acpi_handle handle,
|
||||||
ACPI_FUNCTION_TRACE("acpi_memory_deregister_notify_handler");
|
ACPI_FUNCTION_TRACE("acpi_memory_deregister_notify_handler");
|
||||||
|
|
||||||
status = is_memory_device(handle);
|
status = is_memory_device(handle);
|
||||||
if (ACPI_FAILURE(status))
|
if (ACPI_FAILURE(status)){
|
||||||
|
ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
|
||||||
return_ACPI_STATUS(AE_OK); /* continue */
|
return_ACPI_STATUS(AE_OK); /* continue */
|
||||||
|
}
|
||||||
|
|
||||||
status = acpi_remove_notify_handler(handle,
|
status = acpi_remove_notify_handler(handle,
|
||||||
ACPI_SYSTEM_NOTIFY,
|
ACPI_SYSTEM_NOTIFY,
|
||||||
acpi_memory_device_notify);
|
acpi_memory_device_notify);
|
||||||
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)
|
static int __init acpi_memory_device_init(void)
|
||||||
|
@ -487,7 +472,7 @@ static int __init acpi_memory_device_init(void)
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
if (ACPI_FAILURE(status)) {
|
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);
|
acpi_bus_unregister_driver(&acpi_memory_device_driver);
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
}
|
}
|
||||||
|
@ -511,7 +496,7 @@ static void __exit acpi_memory_device_exit(void)
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
if (ACPI_FAILURE(status))
|
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);
|
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);
|
status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BIF\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF"));
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
|
||||||
|
|
||||||
status = acpi_extract_package(package, &format, &data);
|
status = acpi_extract_package(package, &format, &data);
|
||||||
if (status != AE_BUFFER_OVERFLOW) {
|
if (status != AE_BUFFER_OVERFLOW) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Extracting _BIF"));
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
|
||||||
|
|
||||||
status = acpi_extract_package(package, &format, &data);
|
status = acpi_extract_package(package, &format, &data);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Extracting _BIF"));
|
||||||
kfree(data.pointer);
|
kfree(data.pointer);
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -202,7 +202,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
|
||||||
|
|
||||||
status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer);
|
status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BST\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST"));
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
|
||||||
|
|
||||||
status = acpi_extract_package(package, &format, &data);
|
status = acpi_extract_package(package, &format, &data);
|
||||||
if (status != AE_BUFFER_OVERFLOW) {
|
if (status != AE_BUFFER_OVERFLOW) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Extracting _BST"));
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
|
||||||
|
|
||||||
status = acpi_extract_package(package, &format, &data);
|
status = acpi_extract_package(package, &format, &data);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Extracting _BST"));
|
||||||
kfree(data.pointer);
|
kfree(data.pointer);
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
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)) {
|
if ((bst->state & 0x01) && (bst->state & 0x02)) {
|
||||||
seq_printf(seq,
|
seq_printf(seq,
|
||||||
"charging state: charging/discharging\n");
|
"charging state: charging/discharging\n");
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Battery Charging and Discharging?\n"));
|
|
||||||
} else if (bst->state & 0x01)
|
} else if (bst->state & 0x01)
|
||||||
seq_printf(seq, "charging state: discharging\n");
|
seq_printf(seq, "charging state: discharging\n");
|
||||||
else if (bst->state & 0x02)
|
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,
|
entry = create_proc_entry(ACPI_BATTERY_FILE_INFO,
|
||||||
S_IRUGO, acpi_device_dir(device));
|
S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_BATTERY_FILE_INFO));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_battery_info_ops;
|
entry->proc_fops = &acpi_battery_info_ops;
|
||||||
entry->data = acpi_driver_data(device);
|
entry->data = acpi_driver_data(device);
|
||||||
|
@ -622,9 +618,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
|
||||||
entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS,
|
entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS,
|
||||||
S_IRUGO, acpi_device_dir(device));
|
S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_BATTERY_FILE_STATUS));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_battery_state_ops;
|
entry->proc_fops = &acpi_battery_state_ops;
|
||||||
entry->data = acpi_driver_data(device);
|
entry->data = acpi_driver_data(device);
|
||||||
|
@ -636,9 +630,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
|
||||||
S_IFREG | S_IRUGO | S_IWUSR,
|
S_IFREG | S_IRUGO | S_IWUSR,
|
||||||
acpi_device_dir(device));
|
acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_BATTERY_FILE_ALARM));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_battery_alarm_ops;
|
entry->proc_fops = &acpi_battery_alarm_ops;
|
||||||
entry->data = acpi_driver_data(device);
|
entry->data = acpi_driver_data(device);
|
||||||
|
@ -732,8 +724,6 @@ static int acpi_battery_add(struct acpi_device *device)
|
||||||
ACPI_DEVICE_NOTIFY,
|
ACPI_DEVICE_NOTIFY,
|
||||||
acpi_battery_notify, battery);
|
acpi_battery_notify, battery);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Error installing notify handler\n"));
|
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -766,9 +756,6 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
|
||||||
status = acpi_remove_notify_handler(battery->handle,
|
status = acpi_remove_notify_handler(battery->handle,
|
||||||
ACPI_DEVICE_NOTIFY,
|
ACPI_DEVICE_NOTIFY,
|
||||||
acpi_battery_notify);
|
acpi_battery_notify);
|
||||||
if (ACPI_FAILURE(status))
|
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Error removing notify handler\n"));
|
|
||||||
|
|
||||||
acpi_battery_remove_fs(device);
|
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);
|
status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device);
|
||||||
if (ACPI_FAILURE(status) || !*device) {
|
if (ACPI_FAILURE(status) || !*device) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "No context for object [%p]\n",
|
ACPI_EXCEPTION((AE_INFO, status, "No context for object [%p]", handle));
|
||||||
handle));
|
|
||||||
return_VALUE(-ENODEV);
|
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 */
|
/* Make sure this is a valid target state */
|
||||||
|
|
||||||
if (!device->flags.power_manageable) {
|
if (!device->flags.power_manageable) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_INFO((AE_INFO, "Device is not power manageable"));
|
||||||
"Device is not power manageable\n"));
|
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -215,13 +213,13 @@ int acpi_bus_set_power(acpi_handle handle, int state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!device->power.states[state].flags.valid) {
|
if (!device->power.states[state].flags.valid) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Device does not support D%d\n",
|
ACPI_WARNING((AE_INFO, "Device does not support D%d", state));
|
||||||
state));
|
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
}
|
}
|
||||||
if (device->parent && (state < device->parent->power.state)) {
|
if (device->parent && (state < device->parent->power.state)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO,
|
||||||
"Cannot set device to a higher-powered state than parent\n"));
|
"Cannot set device to a higher-powered"
|
||||||
|
" state than parent"));
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,8 +262,8 @@ int acpi_bus_set_power(acpi_handle handle, int state)
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (result)
|
if (result)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO,
|
||||||
"Error transitioning device [%s] to D%d\n",
|
"Transitioning device [%s] to D%d",
|
||||||
device->pnp.bus_id, state));
|
device->pnp.bus_id, state));
|
||||||
else
|
else
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||||
|
@ -581,7 +579,7 @@ static int __init acpi_bus_init_irq(void)
|
||||||
|
|
||||||
status = acpi_evaluate_object(NULL, "\\_PIC", &arg_list, NULL);
|
status = acpi_evaluate_object(NULL, "\\_PIC", &arg_list, NULL);
|
||||||
if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
|
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);
|
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,
|
entry = create_proc_entry(ACPI_BUTTON_FILE_INFO,
|
||||||
S_IRUGO, acpi_device_dir(device));
|
S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_BUTTON_FILE_INFO));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_button_info_fops;
|
entry->proc_fops = &acpi_button_info_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
entry->data = acpi_driver_data(device);
|
||||||
|
@ -221,9 +219,7 @@ static int acpi_button_add_fs(struct acpi_device *device)
|
||||||
entry = create_proc_entry(ACPI_BUTTON_FILE_STATE,
|
entry = create_proc_entry(ACPI_BUTTON_FILE_STATE,
|
||||||
S_IRUGO, acpi_device_dir(device));
|
S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return -ENODEV;
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_BUTTON_FILE_INFO));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_button_state_fops;
|
entry->proc_fops = &acpi_button_state_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
entry->data = acpi_driver_data(device);
|
||||||
|
@ -349,7 +345,7 @@ static int acpi_button_add(struct acpi_device *device)
|
||||||
sprintf(acpi_device_class(device), "%s/%s",
|
sprintf(acpi_device_class(device), "%s/%s",
|
||||||
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID);
|
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID);
|
||||||
} else {
|
} else {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unsupported hid [%s]\n",
|
ACPI_ERROR((AE_INFO, "Unsupported hid [%s]",
|
||||||
acpi_device_hid(device)));
|
acpi_device_hid(device)));
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -381,8 +377,6 @@ static int acpi_button_add(struct acpi_device *device)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Error installing notify handler\n"));
|
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -440,10 +434,6 @@ static int acpi_button_remove(struct acpi_device *device, int type)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ACPI_FAILURE(status))
|
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Error removing notify handler\n"));
|
|
||||||
|
|
||||||
acpi_button_remove_fs(device);
|
acpi_button_remove_fs(device);
|
||||||
|
|
||||||
kfree(button);
|
kfree(button);
|
||||||
|
|
|
@ -94,7 +94,7 @@ static int acpi_container_add(struct acpi_device *device)
|
||||||
ACPI_FUNCTION_TRACE("acpi_container_add");
|
ACPI_FUNCTION_TRACE("acpi_container_add");
|
||||||
|
|
||||||
if (!device) {
|
if (!device) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "device is NULL\n"));
|
ACPI_ERROR((AE_INFO, "device is NULL"));
|
||||||
return_VALUE(-EINVAL);
|
return_VALUE(-EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -216,12 +216,9 @@ static int __init acpi_debug_init(void)
|
||||||
return_VALUE(error);
|
return_VALUE(error);
|
||||||
|
|
||||||
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_LEVEL, acpi_root_dir);
|
||||||
remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, acpi_root_dir);
|
remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, acpi_root_dir);
|
||||||
error = -EFAULT;
|
error = -ENODEV;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,7 @@ int acpi_ec_enter_burst_mode(union acpi_ec *ec)
|
||||||
atomic_set(&ec->intr.leaving_burst, 0);
|
atomic_set(&ec->intr.leaving_burst, 0);
|
||||||
return_VALUE(0);
|
return_VALUE(0);
|
||||||
end:
|
end:
|
||||||
printk(KERN_WARNING PREFIX "Error in acpi_ec_wait\n");
|
ACPI_EXCEPTION ((AE_INFO, status, "EC wait, burst mode");
|
||||||
return_VALUE(-1);
|
return_VALUE(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,7 +300,7 @@ int acpi_ec_leave_burst_mode(union acpi_ec *ec)
|
||||||
atomic_set(&ec->intr.leaving_burst, 1);
|
atomic_set(&ec->intr.leaving_burst, 1);
|
||||||
return_VALUE(0);
|
return_VALUE(0);
|
||||||
end:
|
end:
|
||||||
printk(KERN_WARNING PREFIX "leave burst_mode:error\n");
|
ACPI_EXCEPTION((AE_INFO, status, "EC leave burst mode");
|
||||||
return_VALUE(-1);
|
return_VALUE(-1);
|
||||||
}
|
}
|
||||||
#endif /* ACPI_FUTURE_USAGE */
|
#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,
|
entry = create_proc_entry(ACPI_EC_FILE_INFO, S_IRUGO,
|
||||||
acpi_device_dir(device));
|
acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_EC_FILE_INFO));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_ec_info_ops;
|
entry->proc_fops = &acpi_ec_info_ops;
|
||||||
entry->data = acpi_driver_data(device);
|
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,
|
acpi_evaluate_integer(ec->common.handle, "_GPE", NULL,
|
||||||
&ec->common.gpe_bit);
|
&ec->common.gpe_bit);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status, "Obtaining GPE bit"));
|
||||||
"Error obtaining GPE bit assignment\n"));
|
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -1110,8 +1107,7 @@ static int acpi_ec_intr_add(struct acpi_device *device)
|
||||||
acpi_evaluate_integer(ec->common.handle, "_GPE", NULL,
|
acpi_evaluate_integer(ec->common.handle, "_GPE", NULL,
|
||||||
&ec->common.gpe_bit);
|
&ec->common.gpe_bit);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Obtaining GPE bit assignment"));
|
||||||
"Error obtaining GPE bit assignment\n"));
|
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -1205,8 +1201,7 @@ static int acpi_ec_start(struct acpi_device *device)
|
||||||
acpi_ec_io_ports, ec);
|
acpi_ec_io_ports, ec);
|
||||||
if (ACPI_FAILURE(status)
|
if (ACPI_FAILURE(status)
|
||||||
|| ec->common.command_addr.register_bit_width == 0) {
|
|| ec->common.command_addr.register_bit_width == 0) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Error getting I/O port addresses"));
|
||||||
"Error getting I/O port addresses"));
|
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,10 +122,7 @@ static int __init acpi_event_init(void)
|
||||||
if (entry)
|
if (entry)
|
||||||
entry->proc_fops = &acpi_system_event_ops;
|
entry->proc_fops = &acpi_system_event_ops;
|
||||||
else {
|
else {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
error = -ENODEV;
|
||||||
"Unable to create '%s' proc fs entry\n",
|
|
||||||
"event"));
|
|
||||||
error = -EFAULT;
|
|
||||||
}
|
}
|
||||||
return_VALUE(error);
|
return_VALUE(error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,9 +153,7 @@ static int acpi_fan_add_fs(struct acpi_device *device)
|
||||||
S_IFREG | S_IRUGO | S_IWUSR,
|
S_IFREG | S_IRUGO | S_IWUSR,
|
||||||
acpi_device_dir(device));
|
acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_FAN_FILE_STATE));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_fan_state_ops;
|
entry->proc_fops = &acpi_fan_state_ops;
|
||||||
entry->data = acpi_driver_data(device);
|
entry->data = acpi_driver_data(device);
|
||||||
|
@ -205,8 +203,7 @@ static int acpi_fan_add(struct acpi_device *device)
|
||||||
|
|
||||||
result = acpi_bus_get_power(fan->handle, &state);
|
result = acpi_bus_get_power(fan->handle, &state);
|
||||||
if (result) {
|
if (result) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Reading power state"));
|
||||||
"Error reading power state\n"));
|
|
||||||
goto end;
|
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);
|
proc = create_proc_entry(proc_name, mode, hotkey_proc_dir);
|
||||||
|
|
||||||
if (!proc) {
|
if (!proc) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Hotkey: Unable to create %s entry\n",
|
|
||||||
device->poll_hotkey.poll_method));
|
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
} else {
|
} else {
|
||||||
proc->proc_fops = &hotkey_polling_fops;
|
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)) {
|
if (copy_from_user(config_record, buffer, count)) {
|
||||||
kfree(config_record);
|
kfree(config_record);
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data \n"));
|
ACPI_ERROR((AE_INFO, "Invalid data"));
|
||||||
return_VALUE(-EINVAL);
|
return_VALUE(-EINVAL);
|
||||||
}
|
}
|
||||||
config_record[count] = 0;
|
config_record[count] = 0;
|
||||||
|
@ -792,8 +789,7 @@ static ssize_t hotkey_write_config(struct file *file,
|
||||||
kfree(bus_method);
|
kfree(bus_method);
|
||||||
kfree(action_handle);
|
kfree(action_handle);
|
||||||
kfree(method);
|
kfree(method);
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Invalid data format ret=%d", ret));
|
||||||
"Invalid data format ret=%d\n", ret));
|
|
||||||
return_VALUE(-EINVAL);
|
return_VALUE(-EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -806,7 +802,7 @@ static ssize_t hotkey_write_config(struct file *file,
|
||||||
tmp = get_hotkey_by_event(&global_hotkey_list,
|
tmp = get_hotkey_by_event(&global_hotkey_list,
|
||||||
internal_event_num);
|
internal_event_num);
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid key"));
|
ACPI_ERROR((AE_INFO, "Invalid key"));
|
||||||
else
|
else
|
||||||
memcpy(key, tmp, sizeof(union acpi_hotkey));
|
memcpy(key, tmp, sizeof(union acpi_hotkey));
|
||||||
goto cont_cmd;
|
goto cont_cmd;
|
||||||
|
@ -828,7 +824,7 @@ static ssize_t hotkey_write_config(struct file *file,
|
||||||
else
|
else
|
||||||
free_poll_hotkey_buffer(key);
|
free_poll_hotkey_buffer(key);
|
||||||
kfree(key);
|
kfree(key);
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid hotkey \n"));
|
ACPI_ERROR((AE_INFO, "Invalid hotkey"));
|
||||||
return_VALUE(-EINVAL);
|
return_VALUE(-EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -862,7 +858,7 @@ static ssize_t hotkey_write_config(struct file *file,
|
||||||
else
|
else
|
||||||
free_poll_hotkey_buffer(key);
|
free_poll_hotkey_buffer(key);
|
||||||
kfree(key);
|
kfree(key);
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "invalid key\n"));
|
ACPI_ERROR((AE_INFO, "invalid key"));
|
||||||
return_VALUE(-EINVAL);
|
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->integer.value = out_obj.integer.value;
|
||||||
val->type = out_obj.type;
|
val->type = out_obj.type;
|
||||||
} else
|
} else
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "null val pointer"));
|
ACPI_ERROR((AE_INFO, "null val pointer"));
|
||||||
return_VALUE((status == AE_OK)
|
return_VALUE((status == AE_OK)
|
||||||
&& (out_obj.type == ACPI_TYPE_INTEGER));
|
&& (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)) {
|
if (copy_from_user(arg, buffer, count)) {
|
||||||
kfree(arg);
|
kfree(arg);
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 2"));
|
ACPI_ERROR((AE_INFO, "Invalid argument 2"));
|
||||||
return_VALUE(-EINVAL);
|
return_VALUE(-EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sscanf(arg, "%d:%d:%d:%d", &event, &method_type, &type, &value) !=
|
if (sscanf(arg, "%d:%d:%d:%d", &event, &method_type, &type, &value) !=
|
||||||
4) {
|
4) {
|
||||||
kfree(arg);
|
kfree(arg);
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 3"));
|
ACPI_ERROR((AE_INFO, "Invalid argument 3"));
|
||||||
return_VALUE(-EINVAL);
|
return_VALUE(-EINVAL);
|
||||||
}
|
}
|
||||||
kfree(arg);
|
kfree(arg);
|
||||||
|
@ -987,7 +983,7 @@ static ssize_t hotkey_execute_aml_method(struct file *file,
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Not supported"));
|
ACPI_WARNING((AE_INFO, "Not supported"));
|
||||||
return_VALUE(-EINVAL);
|
return_VALUE(-EINVAL);
|
||||||
}
|
}
|
||||||
return_VALUE(count);
|
return_VALUE(count);
|
||||||
|
@ -1013,9 +1009,6 @@ static int __init hotkey_init(void)
|
||||||
|
|
||||||
hotkey_proc_dir = proc_mkdir(HOTKEY_PROC, acpi_root_dir);
|
hotkey_proc_dir = proc_mkdir(HOTKEY_PROC, acpi_root_dir);
|
||||||
if (!hotkey_proc_dir) {
|
if (!hotkey_proc_dir) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Hotkey: Unable to create %s entry\n",
|
|
||||||
HOTKEY_PROC));
|
|
||||||
return (-ENODEV);
|
return (-ENODEV);
|
||||||
}
|
}
|
||||||
hotkey_proc_dir->owner = THIS_MODULE;
|
hotkey_proc_dir->owner = THIS_MODULE;
|
||||||
|
@ -1023,9 +1016,6 @@ static int __init hotkey_init(void)
|
||||||
hotkey_config =
|
hotkey_config =
|
||||||
create_proc_entry(HOTKEY_EV_CONFIG, mode, hotkey_proc_dir);
|
create_proc_entry(HOTKEY_EV_CONFIG, mode, hotkey_proc_dir);
|
||||||
if (!hotkey_config) {
|
if (!hotkey_config) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Hotkey: Unable to create %s entry\n",
|
|
||||||
HOTKEY_EV_CONFIG));
|
|
||||||
goto do_fail1;
|
goto do_fail1;
|
||||||
} else {
|
} else {
|
||||||
hotkey_config->proc_fops = &hotkey_config_fops;
|
hotkey_config->proc_fops = &hotkey_config_fops;
|
||||||
|
@ -1038,10 +1028,6 @@ static int __init hotkey_init(void)
|
||||||
hotkey_poll_config =
|
hotkey_poll_config =
|
||||||
create_proc_entry(HOTKEY_PL_CONFIG, mode, hotkey_proc_dir);
|
create_proc_entry(HOTKEY_PL_CONFIG, mode, hotkey_proc_dir);
|
||||||
if (!hotkey_poll_config) {
|
if (!hotkey_poll_config) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Hotkey: Unable to create %s entry\n",
|
|
||||||
HOTKEY_EV_CONFIG));
|
|
||||||
|
|
||||||
goto do_fail2;
|
goto do_fail2;
|
||||||
} else {
|
} else {
|
||||||
hotkey_poll_config->proc_fops = &hotkey_poll_config_fops;
|
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);
|
hotkey_action = create_proc_entry(HOTKEY_ACTION, mode, hotkey_proc_dir);
|
||||||
if (!hotkey_action) {
|
if (!hotkey_action) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Hotkey: Unable to create %s entry\n",
|
|
||||||
HOTKEY_ACTION));
|
|
||||||
goto do_fail3;
|
goto do_fail3;
|
||||||
} else {
|
} else {
|
||||||
hotkey_action->proc_fops = &hotkey_action_fops;
|
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);
|
hotkey_info = create_proc_entry(HOTKEY_INFO, mode, hotkey_proc_dir);
|
||||||
if (!hotkey_info) {
|
if (!hotkey_info) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Hotkey: Unable to create %s entry\n",
|
|
||||||
HOTKEY_INFO));
|
|
||||||
goto do_fail4;
|
goto do_fail4;
|
||||||
} else {
|
} else {
|
||||||
hotkey_info->proc_fops = &hotkey_info_fops;
|
hotkey_info->proc_fops = &hotkey_info_fops;
|
||||||
|
|
|
@ -137,6 +137,7 @@ void acpi_os_vprintf(const char *fmt, va_list args)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern int acpi_in_resume;
|
extern int acpi_in_resume;
|
||||||
void *acpi_os_allocate(acpi_size size)
|
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;
|
dpc = (struct acpi_os_dpc *)context;
|
||||||
if (!dpc) {
|
if (!dpc) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid (NULL) context.\n"));
|
ACPI_ERROR((AE_INFO, "Invalid (NULL) context"));
|
||||||
return_VOID;
|
return_VOID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -839,13 +840,13 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status,
|
||||||
"Failed to acquire semaphore[%p|%d|%d], %s\n",
|
"Failed to acquire semaphore[%p|%d|%d], %s",
|
||||||
handle, units, timeout,
|
handle, units, timeout,
|
||||||
acpi_format_exception(status)));
|
acpi_format_exception(status)));
|
||||||
} else {
|
} else {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
|
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
|
||||||
"Acquired semaphore[%p|%d|%d]\n", handle,
|
"Acquired semaphore[%p|%d|%d]", handle,
|
||||||
units, timeout));
|
units, timeout));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,16 +75,16 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id)
|
||||||
|
|
||||||
result = acpi_bus_get_device(handle, &device);
|
result = acpi_bus_get_device(handle, &device);
|
||||||
if (result) {
|
if (result) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO,
|
||||||
"Invalid ACPI Bus context for device %s\n",
|
"Invalid ACPI Bus context for device %s",
|
||||||
acpi_device_bid(device)));
|
acpi_device_bid(device)));
|
||||||
return_ACPI_STATUS(AE_NOT_EXIST);
|
return_ACPI_STATUS(AE_NOT_EXIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
status = acpi_get_data(handle, acpi_pci_data_handler, (void **)&data);
|
status = acpi_get_data(handle, acpi_pci_data_handler, (void **)&data);
|
||||||
if (ACPI_FAILURE(status) || !data) {
|
if (ACPI_FAILURE(status) || !data) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status,
|
||||||
"Invalid ACPI-PCI context for device %s\n",
|
"Invalid ACPI-PCI context for device %s",
|
||||||
acpi_device_bid(device)));
|
acpi_device_bid(device)));
|
||||||
return_ACPI_STATUS(status);
|
return_ACPI_STATUS(status);
|
||||||
}
|
}
|
||||||
|
@ -151,8 +151,8 @@ int acpi_pci_bind(struct acpi_device *device)
|
||||||
status = acpi_get_data(device->parent->handle, acpi_pci_data_handler,
|
status = acpi_get_data(device->parent->handle, acpi_pci_data_handler,
|
||||||
(void **)&pdata);
|
(void **)&pdata);
|
||||||
if (ACPI_FAILURE(status) || !pdata || !pdata->bus) {
|
if (ACPI_FAILURE(status) || !pdata || !pdata->bus) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status,
|
||||||
"Invalid ACPI-PCI context for parent device %s\n",
|
"Invalid ACPI-PCI context for parent device %s",
|
||||||
acpi_device_bid(device->parent)));
|
acpi_device_bid(device->parent)));
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -206,8 +206,8 @@ int acpi_pci_bind(struct acpi_device *device)
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (!data->dev->bus) {
|
if (!data->dev->bus) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO,
|
||||||
"Device %02x:%02x:%02x.%02x has invalid 'bus' field\n",
|
"Device %02x:%02x:%02x.%02x has invalid 'bus' field",
|
||||||
data->id.segment, data->id.bus,
|
data->id.segment, data->id.bus,
|
||||||
data->id.device, data->id.function));
|
data->id.device, data->id.function));
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
|
@ -237,8 +237,8 @@ int acpi_pci_bind(struct acpi_device *device)
|
||||||
*/
|
*/
|
||||||
status = acpi_attach_data(device->handle, acpi_pci_data_handler, data);
|
status = acpi_attach_data(device->handle, acpi_pci_data_handler, data);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status,
|
||||||
"Unable to attach ACPI-PCI context to device %s\n",
|
"Unable to attach ACPI-PCI context to device %s",
|
||||||
acpi_device_bid(device)));
|
acpi_device_bid(device)));
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -301,8 +301,8 @@ int acpi_pci_unbind(struct acpi_device *device)
|
||||||
acpi_get_data(device->handle, acpi_pci_data_handler,
|
acpi_get_data(device->handle, acpi_pci_data_handler,
|
||||||
(void **)&data);
|
(void **)&data);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status,
|
||||||
"Unable to get data from device %s\n",
|
"Unable to get data from device %s",
|
||||||
acpi_device_bid(device)));
|
acpi_device_bid(device)));
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -310,8 +310,8 @@ int acpi_pci_unbind(struct acpi_device *device)
|
||||||
|
|
||||||
status = acpi_detach_data(device->handle, acpi_pci_data_handler);
|
status = acpi_detach_data(device->handle, acpi_pci_data_handler);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status,
|
||||||
"Unable to detach data from device %s\n",
|
"Unable to detach data from device %s",
|
||||||
acpi_device_bid(device)));
|
acpi_device_bid(device)));
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -369,8 +369,8 @@ acpi_pci_bind_root(struct acpi_device *device,
|
||||||
|
|
||||||
status = acpi_attach_data(device->handle, acpi_pci_data_handler, data);
|
status = acpi_attach_data(device->handle, acpi_pci_data_handler, data);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status,
|
||||||
"Unable to attach ACPI-PCI context to device %s\n",
|
"Unable to attach ACPI-PCI context to device %s",
|
||||||
pathname));
|
pathname));
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
|
|
|
@ -197,7 +197,7 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
|
||||||
kfree(pathname);
|
kfree(pathname);
|
||||||
status = acpi_get_irq_routing_table(handle, &buffer);
|
status = acpi_get_irq_routing_table(handle, &buffer);
|
||||||
if (status != AE_BUFFER_OVERFLOW) {
|
if (status != AE_BUFFER_OVERFLOW) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n",
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]",
|
||||||
acpi_format_exception(status)));
|
acpi_format_exception(status)));
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,7 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)
|
||||||
|
|
||||||
status = acpi_get_irq_routing_table(handle, &buffer);
|
status = acpi_get_irq_routing_table(handle, &buffer);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n",
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]",
|
||||||
acpi_format_exception(status)));
|
acpi_format_exception(status)));
|
||||||
kfree(buffer.pointer);
|
kfree(buffer.pointer);
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
|
@ -269,8 +269,8 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
|
||||||
entry->link.index, triggering,
|
entry->link.index, triggering,
|
||||||
polarity, link);
|
polarity, link);
|
||||||
if (irq < 0) {
|
if (irq < 0) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO,
|
||||||
"Invalid IRQ link routing entry\n"));
|
"Invalid IRQ link routing entry"));
|
||||||
return_VALUE(-1);
|
return_VALUE(-1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -379,8 +379,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (irq < 0) {
|
if (irq < 0) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO, "Unable to derive IRQ for device %s",
|
||||||
"Unable to derive IRQ for device %s\n",
|
|
||||||
pci_name(dev)));
|
pci_name(dev)));
|
||||||
return_VALUE(-1);
|
return_VALUE(-1);
|
||||||
}
|
}
|
||||||
|
@ -421,8 +420,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
|
||||||
pin--;
|
pin--;
|
||||||
|
|
||||||
if (!dev->bus) {
|
if (!dev->bus) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Invalid (NULL) 'bus' field"));
|
||||||
"Invalid (NULL) 'bus' field\n"));
|
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,16 +116,14 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
|
||||||
{
|
{
|
||||||
struct acpi_resource_irq *p = &resource->data.irq;
|
struct acpi_resource_irq *p = &resource->data.irq;
|
||||||
if (!p || !p->interrupt_count) {
|
if (!p || !p->interrupt_count) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO, "Blank IRQ resource"));
|
||||||
"Blank IRQ resource\n"));
|
|
||||||
return_ACPI_STATUS(AE_OK);
|
return_ACPI_STATUS(AE_OK);
|
||||||
}
|
}
|
||||||
for (i = 0;
|
for (i = 0;
|
||||||
(i < p->interrupt_count
|
(i < p->interrupt_count
|
||||||
&& i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
|
&& i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
|
||||||
if (!p->interrupts[i]) {
|
if (!p->interrupts[i]) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO, "Invalid IRQ %d",
|
||||||
"Invalid IRQ %d\n",
|
|
||||||
p->interrupts[i]));
|
p->interrupts[i]));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -142,16 +140,15 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
|
||||||
struct acpi_resource_extended_irq *p =
|
struct acpi_resource_extended_irq *p =
|
||||||
&resource->data.extended_irq;
|
&resource->data.extended_irq;
|
||||||
if (!p || !p->interrupt_count) {
|
if (!p || !p->interrupt_count) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO,
|
||||||
"Blank EXT IRQ resource\n"));
|
"Blank EXT IRQ resource"));
|
||||||
return_ACPI_STATUS(AE_OK);
|
return_ACPI_STATUS(AE_OK);
|
||||||
}
|
}
|
||||||
for (i = 0;
|
for (i = 0;
|
||||||
(i < p->interrupt_count
|
(i < p->interrupt_count
|
||||||
&& i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
|
&& i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
|
||||||
if (!p->interrupts[i]) {
|
if (!p->interrupts[i]) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO, "Invalid IRQ %d",
|
||||||
"Invalid IRQ %d\n",
|
|
||||||
p->interrupts[i]));
|
p->interrupts[i]));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -164,8 +161,7 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Resource is not an IRQ entry\n"));
|
||||||
"Resource is not an IRQ entry\n"));
|
|
||||||
return_ACPI_STATUS(AE_OK);
|
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,
|
status = acpi_walk_resources(link->handle, METHOD_NAME__PRS,
|
||||||
acpi_pci_link_check_possible, link);
|
acpi_pci_link_check_possible, link);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRS\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRS"));
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,8 +223,8 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
|
||||||
* extended IRQ descriptors must
|
* extended IRQ descriptors must
|
||||||
* return at least 1 IRQ
|
* return at least 1 IRQ
|
||||||
*/
|
*/
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO,
|
||||||
"Blank EXT IRQ resource\n"));
|
"Blank EXT IRQ resource"));
|
||||||
return_ACPI_STATUS(AE_OK);
|
return_ACPI_STATUS(AE_OK);
|
||||||
}
|
}
|
||||||
*irq = p->interrupts[0];
|
*irq = p->interrupts[0];
|
||||||
|
@ -236,7 +232,7 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
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:
|
case ACPI_RESOURCE_TYPE_END_TAG:
|
||||||
return_ACPI_STATUS(AE_OK);
|
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 */
|
/* Query _STA, set link->device->status */
|
||||||
result = acpi_bus_get_status(link->device);
|
result = acpi_bus_get_status(link->device);
|
||||||
if (result) {
|
if (result) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Unable to read status"));
|
||||||
"Unable to read status\n"));
|
|
||||||
goto end;
|
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,
|
status = acpi_walk_resources(link->handle, METHOD_NAME__CRS,
|
||||||
acpi_pci_link_check_current, &irq);
|
acpi_pci_link_check_current, &irq);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _CRS\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS"));
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (acpi_strict && !irq) {
|
if (acpi_strict && !irq) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "_CRS returned 0\n"));
|
ACPI_ERROR((AE_INFO, "_CRS returned 0"));
|
||||||
result = -ENODEV;
|
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 */
|
/* ignore resource_source, it's optional */
|
||||||
break;
|
break;
|
||||||
default:
|
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;
|
result = -EINVAL;
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
@ -374,7 +369,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
|
||||||
|
|
||||||
/* check for total failure */
|
/* check for total failure */
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SRS"));
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -382,14 +377,14 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
|
||||||
/* Query _STA, set device->status */
|
/* Query _STA, set device->status */
|
||||||
result = acpi_bus_get_status(link->device);
|
result = acpi_bus_get_status(link->device);
|
||||||
if (result) {
|
if (result) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to read status\n"));
|
ACPI_ERROR((AE_INFO, "Unable to read status"));
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (!link->device->status.enabled) {
|
if (!link->device->status.enabled) {
|
||||||
printk(KERN_WARNING PREFIX
|
ACPI_WARNING((AE_INFO,
|
||||||
"%s [%s] disabled and referenced, BIOS bug.\n",
|
"%s [%s] disabled and referenced, BIOS bug",
|
||||||
acpi_device_name(link->device),
|
acpi_device_name(link->device),
|
||||||
acpi_device_bid(link->device));
|
acpi_device_bid(link->device)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Query _CRS, set link->irq.active */
|
/* 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
|
* policy: when _CRS doesn't return what we just _SRS
|
||||||
* assume _SRS worked and override _CRS value.
|
* assume _SRS worked and override _CRS value.
|
||||||
*/
|
*/
|
||||||
printk(KERN_WARNING PREFIX
|
ACPI_WARNING((AE_INFO,
|
||||||
"%s [%s] BIOS reported IRQ %d, using IRQ %d\n",
|
"%s [%s] BIOS reported IRQ %d, using IRQ %d",
|
||||||
acpi_device_name(link->device),
|
acpi_device_name(link->device),
|
||||||
acpi_device_bid(link->device), link->irq.active, irq);
|
acpi_device_bid(link->device), link->irq.active, irq));
|
||||||
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);
|
link = list_entry(node, struct acpi_pci_link, node);
|
||||||
if (!link) {
|
if (!link) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Invalid link context"));
|
||||||
"Invalid link context\n"));
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -561,8 +555,8 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
|
||||||
*/
|
*/
|
||||||
if (i == link->irq.possible_count) {
|
if (i == link->irq.possible_count) {
|
||||||
if (acpi_strict)
|
if (acpi_strict)
|
||||||
printk(KERN_WARNING PREFIX "_CRS %d not found"
|
ACPI_WARNING((AE_INFO, "_CRS %d not found"
|
||||||
" in _PRS\n", link->irq.active);
|
" in _PRS", link->irq.active));
|
||||||
link->irq.active = 0;
|
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. */
|
/* Attempt to enable the link device at this IRQ. */
|
||||||
if (acpi_pci_link_set(link, irq)) {
|
if (acpi_pci_link_set(link, irq)) {
|
||||||
printk(PREFIX
|
ACPI_ERROR((AE_INFO, "Unable to set IRQ for %s [%s]. "
|
||||||
"Unable to set IRQ for %s [%s] (likely buggy ACPI BIOS).\n"
|
"Try pci=noacpi or acpi=off",
|
||||||
"Try pci=noacpi or acpi=off\n",
|
|
||||||
acpi_device_name(link->device),
|
acpi_device_name(link->device),
|
||||||
acpi_device_bid(link->device));
|
acpi_device_bid(link->device)));
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
} else {
|
} else {
|
||||||
acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING;
|
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);
|
result = acpi_bus_get_device(handle, &device);
|
||||||
if (result) {
|
if (result) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n"));
|
ACPI_ERROR((AE_INFO, "Invalid link device"));
|
||||||
return_VALUE(-1);
|
return_VALUE(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
link = (struct acpi_pci_link *)acpi_driver_data(device);
|
link = (struct acpi_pci_link *)acpi_driver_data(device);
|
||||||
if (!link) {
|
if (!link) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n"));
|
ACPI_ERROR((AE_INFO, "Invalid link context"));
|
||||||
return_VALUE(-1);
|
return_VALUE(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TBD: Support multiple index (IRQ) entries per Link Device */
|
/* TBD: Support multiple index (IRQ) entries per Link Device */
|
||||||
if (index) {
|
if (index) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid index %d\n", index));
|
ACPI_ERROR((AE_INFO, "Invalid index %d", index));
|
||||||
return_VALUE(-1);
|
return_VALUE(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,7 +643,7 @@ acpi_pci_link_allocate_irq(acpi_handle handle,
|
||||||
|
|
||||||
if (!link->irq.active) {
|
if (!link->irq.active) {
|
||||||
mutex_unlock(&acpi_link_lock);
|
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);
|
return_VALUE(-1);
|
||||||
}
|
}
|
||||||
link->refcnt++;
|
link->refcnt++;
|
||||||
|
@ -682,20 +675,20 @@ int acpi_pci_link_free_irq(acpi_handle handle)
|
||||||
|
|
||||||
result = acpi_bus_get_device(handle, &device);
|
result = acpi_bus_get_device(handle, &device);
|
||||||
if (result) {
|
if (result) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n"));
|
ACPI_ERROR((AE_INFO, "Invalid link device"));
|
||||||
return_VALUE(-1);
|
return_VALUE(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
link = (struct acpi_pci_link *)acpi_driver_data(device);
|
link = (struct acpi_pci_link *)acpi_driver_data(device);
|
||||||
if (!link) {
|
if (!link) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n"));
|
ACPI_ERROR((AE_INFO, "Invalid link context"));
|
||||||
return_VALUE(-1);
|
return_VALUE(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock(&acpi_link_lock);
|
mutex_lock(&acpi_link_lock);
|
||||||
if (!link->irq.initialized) {
|
if (!link->irq.initialized) {
|
||||||
mutex_unlock(&acpi_link_lock);
|
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);
|
return_VALUE(-1);
|
||||||
}
|
}
|
||||||
#ifdef FUTURE_USE
|
#ifdef FUTURE_USE
|
||||||
|
@ -820,8 +813,7 @@ static int irqrouter_resume(struct sys_device *dev)
|
||||||
list_for_each(node, &acpi_link.entries) {
|
list_for_each(node, &acpi_link.entries) {
|
||||||
link = list_entry(node, struct acpi_pci_link, node);
|
link = list_entry(node, struct acpi_pci_link, node);
|
||||||
if (!link) {
|
if (!link) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Invalid link context"));
|
||||||
"Invalid link context\n"));
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
acpi_pci_link_resume(link);
|
acpi_pci_link_resume(link);
|
||||||
|
|
|
@ -198,7 +198,7 @@ static int acpi_pci_root_add(struct acpi_device *device)
|
||||||
root->id.segment = 0;
|
root->id.segment = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SEG\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SEG"));
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -219,7 +219,7 @@ static int acpi_pci_root_add(struct acpi_device *device)
|
||||||
root->id.bus = 0;
|
root->id.bus = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BBN\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BBN"));
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -231,8 +231,9 @@ static int acpi_pci_root_add(struct acpi_device *device)
|
||||||
int bus = 0;
|
int bus = 0;
|
||||||
acpi_status status;
|
acpi_status status;
|
||||||
|
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO,
|
||||||
"Wrong _BBN value, please reboot and using option 'pci=noacpi'\n"));
|
"Wrong _BBN value, reboot"
|
||||||
|
" and use option 'pci=noacpi'"));
|
||||||
|
|
||||||
status = try_get_root_bridge_busnr(root->handle, &bus);
|
status = try_get_root_bridge_busnr(root->handle, &bus);
|
||||||
if (ACPI_FAILURE(status))
|
if (ACPI_FAILURE(status))
|
||||||
|
@ -273,8 +274,8 @@ static int acpi_pci_root_add(struct acpi_device *device)
|
||||||
*/
|
*/
|
||||||
root->bus = pci_acpi_scan_root(device, root->id.segment, root->id.bus);
|
root->bus = pci_acpi_scan_root(device, root->id.segment, root->id.bus);
|
||||||
if (!root->bus) {
|
if (!root->bus) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO,
|
||||||
"Bus %04x:%02x not present in PCI namespace\n",
|
"Bus %04x:%02x not present in PCI namespace",
|
||||||
root->id.segment, root->id.bus));
|
root->id.segment, root->id.bus));
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
|
|
|
@ -105,8 +105,7 @@ acpi_power_get_context(acpi_handle handle,
|
||||||
|
|
||||||
result = acpi_bus_get_device(handle, &device);
|
result = acpi_bus_get_device(handle, &device);
|
||||||
if (result) {
|
if (result) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error getting context [%p]\n",
|
ACPI_WARNING((AE_INFO, "Getting context [%p]", handle));
|
||||||
handle));
|
|
||||||
return_VALUE(result);
|
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++) {
|
for (i = 0; i < dev->wakeup.resources.count; i++) {
|
||||||
ret = acpi_power_on(dev->wakeup.resources.handles[i]);
|
ret = acpi_power_on(dev->wakeup.resources.handles[i]);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Transition power state"));
|
||||||
"Error transition power state\n"));
|
|
||||||
dev->wakeup.flags.valid = 0;
|
dev->wakeup.flags.valid = 0;
|
||||||
return_VALUE(-1);
|
return_VALUE(-1);
|
||||||
}
|
}
|
||||||
|
@ -302,7 +300,7 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev)
|
||||||
/* Execute PSW */
|
/* Execute PSW */
|
||||||
status = acpi_evaluate_object(dev->handle, "_PSW", &arg_list, NULL);
|
status = acpi_evaluate_object(dev->handle, "_PSW", &arg_list, NULL);
|
||||||
if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
|
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;
|
dev->wakeup.flags.valid = 0;
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
|
@ -332,7 +330,7 @@ int acpi_disable_wakeup_device_power(struct acpi_device *dev)
|
||||||
/* Execute PSW */
|
/* Execute PSW */
|
||||||
status = acpi_evaluate_object(dev->handle, "_PSW", &arg_list, NULL);
|
status = acpi_evaluate_object(dev->handle, "_PSW", &arg_list, NULL);
|
||||||
if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
|
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;
|
dev->wakeup.flags.valid = 0;
|
||||||
return_VALUE(-1);
|
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++) {
|
for (i = 0; i < dev->wakeup.resources.count; i++) {
|
||||||
ret = acpi_power_off_device(dev->wakeup.resources.handles[i]);
|
ret = acpi_power_off_device(dev->wakeup.resources.handles[i]);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Transition power state"));
|
||||||
"Error transition power state\n"));
|
|
||||||
dev->wakeup.flags.valid = 0;
|
dev->wakeup.flags.valid = 0;
|
||||||
return_VALUE(-1);
|
return_VALUE(-1);
|
||||||
}
|
}
|
||||||
|
@ -444,8 +441,7 @@ int acpi_power_transition(struct acpi_device *device, int state)
|
||||||
device->power.state = state;
|
device->power.state = state;
|
||||||
end:
|
end:
|
||||||
if (result)
|
if (result)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO, "Transitioning device [%s] to D%d",
|
||||||
"Error transitioning device [%s] to D%d\n",
|
|
||||||
device->pnp.bus_id, state));
|
device->pnp.bus_id, state));
|
||||||
|
|
||||||
return_VALUE(result);
|
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,
|
entry = create_proc_entry(ACPI_POWER_FILE_STATUS,
|
||||||
S_IRUGO, acpi_device_dir(device));
|
S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-EIO);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_POWER_FILE_STATUS));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_power_fops;
|
entry->proc_fops = &acpi_power_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
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,
|
entry = create_proc_entry(ACPI_PROCESSOR_FILE_INFO,
|
||||||
S_IRUGO, acpi_device_dir(device));
|
S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-EIO);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_PROCESSOR_FILE_INFO));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_processor_info_fops;
|
entry->proc_fops = &acpi_processor_info_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
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,
|
S_IFREG | S_IRUGO | S_IWUSR,
|
||||||
acpi_device_dir(device));
|
acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-EIO);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_PROCESSOR_FILE_THROTTLING));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_processor_throttling_fops;
|
entry->proc_fops = &acpi_processor_throttling_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
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,
|
S_IFREG | S_IRUGO | S_IWUSR,
|
||||||
acpi_device_dir(device));
|
acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE( -EIO);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_PROCESSOR_FILE_LIMIT));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_processor_limit_fops;
|
entry->proc_fops = &acpi_processor_limit_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
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);
|
status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Evaluating processor object"));
|
||||||
"Error evaluating processor object\n"));
|
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -490,8 +483,8 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
|
||||||
if (cpu_index == -1) {
|
if (cpu_index == -1) {
|
||||||
if (ACPI_FAILURE
|
if (ACPI_FAILURE
|
||||||
(acpi_processor_hotadd_init(pr->handle, &pr->id))) {
|
(acpi_processor_hotadd_init(pr->handle, &pr->id))) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO,
|
||||||
"Error getting cpuindex for acpiid 0x%x\n",
|
"Getting cpuindex for acpiid 0x%x",
|
||||||
pr->acpi_id));
|
pr->acpi_id));
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
}
|
}
|
||||||
|
@ -503,7 +496,7 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
|
||||||
if (!object.processor.pblk_address)
|
if (!object.processor.pblk_address)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n"));
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n"));
|
||||||
else if (object.processor.pblk_length != 6)
|
else if (object.processor.pblk_length != 6)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid PBLK length [%d]\n",
|
ACPI_ERROR((AE_INFO, "Invalid PBLK length [%d]",
|
||||||
object.processor.pblk_length));
|
object.processor.pblk_length));
|
||||||
else {
|
else {
|
||||||
pr->throttling.address = object.processor.pblk_address;
|
pr->throttling.address = object.processor.pblk_address;
|
||||||
|
@ -572,10 +565,6 @@ static int acpi_processor_start(struct acpi_device *device)
|
||||||
|
|
||||||
status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
|
status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
|
||||||
acpi_processor_notify, pr);
|
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.). */
|
/* _PDC call should be done before doing anything else (if reqd.). */
|
||||||
arch_acpi_processor_init_pdc(pr);
|
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,
|
status = acpi_remove_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
|
||||||
acpi_processor_notify);
|
acpi_processor_notify);
|
||||||
if (ACPI_FAILURE(status)) {
|
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Error removing notify handler\n"));
|
|
||||||
}
|
|
||||||
|
|
||||||
acpi_processor_remove_fs(device);
|
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);
|
status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
|
||||||
if (ACPI_FAILURE(status) || !(sta & ACPI_STA_PRESENT)) {
|
if (ACPI_FAILURE(status) || !(sta & ACPI_STA_PRESENT)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present"));
|
||||||
"Processor Device is not present\n"));
|
|
||||||
return_VALUE(0);
|
return_VALUE(0);
|
||||||
}
|
}
|
||||||
return_VALUE(1);
|
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)) {
|
if (acpi_bus_get_device(handle, &device)) {
|
||||||
result = acpi_processor_device_add(handle, &device);
|
result = acpi_processor_device_add(handle, &device);
|
||||||
if (result)
|
if (result)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO,
|
||||||
"Unable to add the device\n"));
|
"Unable to add the device"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr = acpi_driver_data(device);
|
pr = acpi_driver_data(device);
|
||||||
if (!pr) {
|
if (!pr) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Driver data is NULL"));
|
||||||
"Driver data is NULL\n"));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -788,8 +771,7 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
|
||||||
if ((!result) && ((pr->id >= 0) && (pr->id < NR_CPUS))) {
|
if ((!result) && ((pr->id >= 0) && (pr->id < NR_CPUS))) {
|
||||||
kobject_uevent(&device->kobj, KOBJ_ONLINE);
|
kobject_uevent(&device->kobj, KOBJ_ONLINE);
|
||||||
} else {
|
} else {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Device [%s] failed to start",
|
||||||
"Device [%s] failed to start\n",
|
|
||||||
acpi_device_bid(device)));
|
acpi_device_bid(device)));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -798,14 +780,14 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
|
||||||
"received ACPI_NOTIFY_EJECT_REQUEST\n"));
|
"received ACPI_NOTIFY_EJECT_REQUEST\n"));
|
||||||
|
|
||||||
if (acpi_bus_get_device(handle, &device)) {
|
if (acpi_bus_get_device(handle, &device)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO,
|
||||||
"Device don't exist, dropping EJECT\n"));
|
"Device don't exist, dropping EJECT"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pr = acpi_driver_data(device);
|
pr = acpi_driver_data(device);
|
||||||
if (!pr) {
|
if (!pr) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO,
|
||||||
"Driver data is NULL, dropping EJECT\n"));
|
"Driver data is NULL, dropping EJECT"));
|
||||||
return_VOID;
|
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 */
|
/* There must be at least 2 elements */
|
||||||
if (!cst || (cst->type != ACPI_TYPE_PACKAGE) || cst->package.count < 2) {
|
if (!cst || (cst->type != ACPI_TYPE_PACKAGE) || cst->package.count < 2) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "not enough elements in _CST"));
|
||||||
"not enough elements in _CST\n"));
|
|
||||||
status = -EFAULT;
|
status = -EFAULT;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -684,8 +683,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
|
||||||
|
|
||||||
/* Validate number of power states. */
|
/* Validate number of power states. */
|
||||||
if (count < 1 || count != cst->package.count - 1) {
|
if (count < 1 || count != cst->package.count - 1) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "count given by _CST is not valid"));
|
||||||
"count given by _CST is not valid\n"));
|
|
||||||
status = -EFAULT;
|
status = -EFAULT;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -1112,8 +1110,8 @@ int acpi_processor_power_init(struct acpi_processor *pr,
|
||||||
status =
|
status =
|
||||||
acpi_os_write_port(acpi_fadt.smi_cmd, acpi_fadt.cst_cnt, 8);
|
acpi_os_write_port(acpi_fadt.smi_cmd, acpi_fadt.cst_cnt, 8);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status,
|
||||||
"Notifying BIOS of _CST ability failed\n"));
|
"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,
|
entry = create_proc_entry(ACPI_PROCESSOR_FILE_POWER,
|
||||||
S_IRUGO, acpi_device_dir(device));
|
S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return -EIO;
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_PROCESSOR_FILE_POWER));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_processor_power_fops;
|
entry->proc_fops = &acpi_processor_power_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
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;
|
acpi_processor_ppc_status |= PPC_IN_USE;
|
||||||
|
|
||||||
if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
|
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);
|
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);
|
status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PCT\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PCT"));
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
}
|
}
|
||||||
|
|
||||||
pct = (union acpi_object *)buffer.pointer;
|
pct = (union acpi_object *)buffer.pointer;
|
||||||
if (!pct || (pct->type != ACPI_TYPE_PACKAGE)
|
if (!pct || (pct->type != ACPI_TYPE_PACKAGE)
|
||||||
|| (pct->package.count != 2)) {
|
|| (pct->package.count != 2)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PCT data\n"));
|
ACPI_ERROR((AE_INFO, "Invalid _PCT data"));
|
||||||
result = -EFAULT;
|
result = -EFAULT;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -193,8 +193,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
|
||||||
if ((obj.type != ACPI_TYPE_BUFFER)
|
if ((obj.type != ACPI_TYPE_BUFFER)
|
||||||
|| (obj.buffer.length < sizeof(struct acpi_pct_register))
|
|| (obj.buffer.length < sizeof(struct acpi_pct_register))
|
||||||
|| (obj.buffer.pointer == NULL)) {
|
|| (obj.buffer.pointer == NULL)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Invalid _PCT data (control_register)"));
|
||||||
"Invalid _PCT data (control_register)\n"));
|
|
||||||
result = -EFAULT;
|
result = -EFAULT;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -210,8 +209,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
|
||||||
if ((obj.type != ACPI_TYPE_BUFFER)
|
if ((obj.type != ACPI_TYPE_BUFFER)
|
||||||
|| (obj.buffer.length < sizeof(struct acpi_pct_register))
|
|| (obj.buffer.length < sizeof(struct acpi_pct_register))
|
||||||
|| (obj.buffer.pointer == NULL)) {
|
|| (obj.buffer.pointer == NULL)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Invalid _PCT data (status_register)"));
|
||||||
"Invalid _PCT data (status_register)\n"));
|
|
||||||
result = -EFAULT;
|
result = -EFAULT;
|
||||||
goto end;
|
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);
|
status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PSS\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PSS"));
|
||||||
return_VALUE(-ENODEV);
|
return_VALUE(-ENODEV);
|
||||||
}
|
}
|
||||||
|
|
||||||
pss = (union acpi_object *)buffer.pointer;
|
pss = (union acpi_object *)buffer.pointer;
|
||||||
if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) {
|
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;
|
result = -EFAULT;
|
||||||
goto end;
|
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]),
|
status = acpi_extract_package(&(pss->package.elements[i]),
|
||||||
&format, &state);
|
&format, &state);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status, "Invalid _PSS data"));
|
||||||
"Invalid _PSS data\n"));
|
|
||||||
result = -EFAULT;
|
result = -EFAULT;
|
||||||
kfree(pr->performance->states);
|
kfree(pr->performance->states);
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -291,8 +288,8 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
|
||||||
(u32) px->control, (u32) px->status));
|
(u32) px->control, (u32) px->status));
|
||||||
|
|
||||||
if (!px->core_frequency) {
|
if (!px->core_frequency) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO,
|
||||||
"Invalid _PSS data: freq is zero\n"));
|
"Invalid _PSS data: freq is zero"));
|
||||||
result = -EFAULT;
|
result = -EFAULT;
|
||||||
kfree(pr->performance->states);
|
kfree(pr->performance->states);
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -387,9 +384,9 @@ int acpi_processor_notify_smm(struct module *calling_module)
|
||||||
status = acpi_os_write_port(acpi_fadt.smi_cmd,
|
status = acpi_os_write_port(acpi_fadt.smi_cmd,
|
||||||
(u32) acpi_fadt.pstate_cnt, 8);
|
(u32) acpi_fadt.pstate_cnt, 8);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status,
|
||||||
"Failed to write pstate_cnt [0x%x] to "
|
"Failed to write pstate_cnt [0x%x] to "
|
||||||
"smi_cmd [0x%x]\n", acpi_fadt.pstate_cnt,
|
"smi_cmd [0x%x]", acpi_fadt.pstate_cnt,
|
||||||
acpi_fadt.smi_cmd));
|
acpi_fadt.smi_cmd));
|
||||||
module_put(calling_module);
|
module_put(calling_module);
|
||||||
return_VALUE(status);
|
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,
|
entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
|
||||||
S_IFREG | S_IRUGO | S_IWUSR,
|
S_IFREG | S_IRUGO | S_IWUSR,
|
||||||
acpi_device_dir(device));
|
acpi_device_dir(device));
|
||||||
if (!entry)
|
if (entry){
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_PROCESSOR_FILE_PERFORMANCE));
|
|
||||||
else {
|
|
||||||
acpi_processor_perf_fops.write = acpi_processor_write_performance;
|
acpi_processor_perf_fops.write = acpi_processor_write_performance;
|
||||||
entry->proc_fops = &acpi_processor_perf_fops;
|
entry->proc_fops = &acpi_processor_perf_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
entry->data = acpi_driver_data(device);
|
||||||
|
|
|
@ -82,7 +82,7 @@ static int acpi_processor_apply_limit(struct acpi_processor *pr)
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (result)
|
if (result)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to set limit\n"));
|
ACPI_ERROR((AE_INFO, "Unable to set limit"));
|
||||||
|
|
||||||
return_VALUE(result);
|
return_VALUE(result);
|
||||||
}
|
}
|
||||||
|
@ -289,8 +289,7 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type)
|
||||||
|
|
||||||
result = acpi_processor_apply_limit(pr);
|
result = acpi_processor_apply_limit(pr);
|
||||||
if (result)
|
if (result)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Unable to set thermal limit"));
|
||||||
"Unable to set thermal limit\n"));
|
|
||||||
|
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Thermal limit now (P%d:T%d)\n",
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Thermal limit now (P%d:T%d)\n",
|
||||||
pr->limit.thermal.px, pr->limit.thermal.tx));
|
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");
|
ACPI_FUNCTION_TRACE("acpi_processor_write_limit");
|
||||||
|
|
||||||
if (!pr || (count > sizeof(limit_string) - 1)) {
|
if (!pr || (count > sizeof(limit_string) - 1)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
|
|
||||||
return_VALUE(-EINVAL);
|
return_VALUE(-EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copy_from_user(limit_string, buffer, count)) {
|
if (copy_from_user(limit_string, buffer, count)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data\n"));
|
|
||||||
return_VALUE(-EFAULT);
|
return_VALUE(-EFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
limit_string[count] = '\0';
|
limit_string[count] = '\0';
|
||||||
|
|
||||||
if (sscanf(limit_string, "%d:%d", &px, &tx) != 2) {
|
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);
|
return_VALUE(-EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pr->flags.throttling) {
|
if (pr->flags.throttling) {
|
||||||
if ((tx < 0) || (tx > (pr->throttling.state_count - 1))) {
|
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);
|
return_VALUE(-EINVAL);
|
||||||
}
|
}
|
||||||
pr->limit.user.tx = tx;
|
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. */
|
/* TBD: Support duty_cycle values that span bit 4. */
|
||||||
else if ((pr->throttling.duty_offset + pr->throttling.duty_width) > 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);
|
return_VALUE(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -311,15 +311,14 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
|
||||||
/* _PRW */
|
/* _PRW */
|
||||||
status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer);
|
status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRW\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW"));
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
package = (union acpi_object *)buffer.pointer;
|
package = (union acpi_object *)buffer.pointer;
|
||||||
status = acpi_bus_extract_wakeup_device_power_package(device, package);
|
status = acpi_bus_extract_wakeup_device_power_package(device, package);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status, "Extracting _PRW package"));
|
||||||
"Error extracting _PRW package\n"));
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -970,7 +969,7 @@ acpi_add_single_object(struct acpi_device **child,
|
||||||
|
|
||||||
device = kmalloc(sizeof(struct acpi_device), GFP_KERNEL);
|
device = kmalloc(sizeof(struct acpi_device), GFP_KERNEL);
|
||||||
if (!device) {
|
if (!device) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Memory allocation error\n"));
|
ACPI_ERROR((AE_INFO, "Memory allocation error"));
|
||||||
return_VALUE(-ENOMEM);
|
return_VALUE(-ENOMEM);
|
||||||
}
|
}
|
||||||
memset(device, 0, sizeof(struct acpi_device));
|
memset(device, 0, sizeof(struct acpi_device));
|
||||||
|
|
|
@ -161,9 +161,6 @@ static int __init acpi_system_init(void)
|
||||||
return_VALUE(error);
|
return_VALUE(error);
|
||||||
|
|
||||||
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_FADT, acpi_root_dir);
|
||||||
remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir);
|
remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir);
|
||||||
remove_proc_entry(ACPI_SYSTEM_FILE_INFO, 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);
|
&tz->trips.critical.temperature);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
tz->trips.critical.flags.valid = 0;
|
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);
|
return_VALUE(-ENODEV);
|
||||||
} else {
|
} else {
|
||||||
tz->trips.critical.flags.valid = 1;
|
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;
|
tz->trips.passive.flags.valid = 0;
|
||||||
|
|
||||||
if (!tz->trips.passive.flags.valid)
|
if (!tz->trips.passive.flags.valid)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO, "Invalid passive threshold"));
|
||||||
"Invalid passive threshold\n"));
|
|
||||||
else
|
else
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||||
"Found passive threshold [%lu]\n",
|
"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",
|
"Found active threshold [%d]:[%lu]\n",
|
||||||
i, tz->trips.active[i].temperature));
|
i, tz->trips.active[i].temperature));
|
||||||
} else
|
} else
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status,
|
||||||
"Invalid active threshold [%d]\n",
|
"Invalid active threshold [%d]", i));
|
||||||
i));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return_VALUE(0);
|
return_VALUE(0);
|
||||||
|
@ -471,7 +469,7 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
|
||||||
return_VALUE(-EINVAL);
|
return_VALUE(-EINVAL);
|
||||||
|
|
||||||
if (tz->temperature >= tz->trips.critical.temperature) {
|
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;
|
tz->trips.critical.flags.enabled = 1;
|
||||||
} else if (tz->trips.critical.flags.enabled)
|
} else if (tz->trips.critical.flags.enabled)
|
||||||
tz->trips.critical.flags.enabled = 0;
|
tz->trips.critical.flags.enabled = 0;
|
||||||
|
@ -502,7 +500,7 @@ static int acpi_thermal_hot(struct acpi_thermal *tz)
|
||||||
return_VALUE(-EINVAL);
|
return_VALUE(-EINVAL);
|
||||||
|
|
||||||
if (tz->temperature >= tz->trips.hot.temperature) {
|
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;
|
tz->trips.hot.flags.enabled = 1;
|
||||||
} else if (tz->trips.hot.flags.enabled)
|
} else if (tz->trips.hot.flags.enabled)
|
||||||
tz->trips.hot.flags.enabled = 0;
|
tz->trips.hot.flags.enabled = 0;
|
||||||
|
@ -642,8 +640,8 @@ static void acpi_thermal_active(struct acpi_thermal *tz)
|
||||||
handles[j],
|
handles[j],
|
||||||
ACPI_STATE_D0);
|
ACPI_STATE_D0);
|
||||||
if (result) {
|
if (result) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO,
|
||||||
"Unable to turn cooling device [%p] 'on'\n",
|
"Unable to turn cooling device [%p] 'on'",
|
||||||
active->devices.
|
active->devices.
|
||||||
handles[j]));
|
handles[j]));
|
||||||
continue;
|
continue;
|
||||||
|
@ -667,8 +665,8 @@ static void acpi_thermal_active(struct acpi_thermal *tz)
|
||||||
result = acpi_bus_set_power(active->devices.handles[j],
|
result = acpi_bus_set_power(active->devices.handles[j],
|
||||||
ACPI_STATE_D3);
|
ACPI_STATE_D3);
|
||||||
if (result) {
|
if (result) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO,
|
||||||
"Unable to turn cooling device [%p] 'off'\n",
|
"Unable to turn cooling device [%p] 'off'",
|
||||||
active->devices.handles[j]));
|
active->devices.handles[j]));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -700,7 +698,7 @@ static void acpi_thermal_check(void *data)
|
||||||
ACPI_FUNCTION_TRACE("acpi_thermal_check");
|
ACPI_FUNCTION_TRACE("acpi_thermal_check");
|
||||||
|
|
||||||
if (!tz) {
|
if (!tz) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid (NULL) context.\n"));
|
ACPI_ERROR((AE_INFO, "Invalid (NULL) context"));
|
||||||
return_VOID;
|
return_VOID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -949,13 +947,11 @@ acpi_thermal_write_trip_points(struct file *file,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) {
|
if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
|
|
||||||
count = -EINVAL;
|
count = -EINVAL;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copy_from_user(limit_string, buffer, count)) {
|
if (copy_from_user(limit_string, buffer, count)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data\n"));
|
|
||||||
count = -EFAULT;
|
count = -EFAULT;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -968,7 +964,6 @@ acpi_thermal_write_trip_points(struct file *file,
|
||||||
&active[5], &active[6], &active[7], &active[8],
|
&active[5], &active[6], &active[7], &active[8],
|
||||||
&active[9]);
|
&active[9]);
|
||||||
if (!(num >= 5 && num < (ACPI_THERMAL_MAX_ACTIVE + 3))) {
|
if (!(num >= 5 && num < (ACPI_THERMAL_MAX_ACTIVE + 3))) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n"));
|
|
||||||
count = -EINVAL;
|
count = -EINVAL;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -1128,9 +1123,7 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
|
||||||
entry = create_proc_entry(ACPI_THERMAL_FILE_STATE,
|
entry = create_proc_entry(ACPI_THERMAL_FILE_STATE,
|
||||||
S_IRUGO, acpi_device_dir(device));
|
S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_THERMAL_FILE_STATE));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_thermal_state_fops;
|
entry->proc_fops = &acpi_thermal_state_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
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,
|
entry = create_proc_entry(ACPI_THERMAL_FILE_TEMPERATURE,
|
||||||
S_IRUGO, acpi_device_dir(device));
|
S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_THERMAL_FILE_TEMPERATURE));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_thermal_temp_fops;
|
entry->proc_fops = &acpi_thermal_temp_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
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,
|
S_IFREG | S_IRUGO | S_IWUSR,
|
||||||
acpi_device_dir(device));
|
acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_THERMAL_FILE_TRIP_POINTS));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_thermal_trip_fops;
|
entry->proc_fops = &acpi_thermal_trip_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
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,
|
S_IFREG | S_IRUGO | S_IWUSR,
|
||||||
acpi_device_dir(device));
|
acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_THERMAL_FILE_COOLING_MODE));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_thermal_cooling_fops;
|
entry->proc_fops = &acpi_thermal_cooling_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
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,
|
S_IFREG | S_IRUGO | S_IWUSR,
|
||||||
acpi_device_dir(device));
|
acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create '%s' fs entry\n",
|
|
||||||
ACPI_THERMAL_FILE_POLLING_FREQ));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_thermal_polling_fops;
|
entry->proc_fops = &acpi_thermal_polling_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
entry->data = acpi_driver_data(device);
|
||||||
|
@ -1355,8 +1340,6 @@ static int acpi_thermal_add(struct acpi_device *device)
|
||||||
ACPI_DEVICE_NOTIFY,
|
ACPI_DEVICE_NOTIFY,
|
||||||
acpi_thermal_notify, tz);
|
acpi_thermal_notify, tz);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Error installing notify handler\n"));
|
|
||||||
result = -ENODEV;
|
result = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -1398,9 +1381,6 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
|
||||||
status = acpi_remove_notify_handler(tz->handle,
|
status = acpi_remove_notify_handler(tz->handle,
|
||||||
ACPI_DEVICE_NOTIFY,
|
ACPI_DEVICE_NOTIFY,
|
||||||
acpi_thermal_notify);
|
acpi_thermal_notify);
|
||||||
if (ACPI_FAILURE(status))
|
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Error removing notify handler\n"));
|
|
||||||
|
|
||||||
/* Terminate policy */
|
/* Terminate policy */
|
||||||
if (tz->trips.passive.flags.valid && tz->trips.passive.flags.enabled) {
|
if (tz->trips.passive.flags.valid && tz->trips.passive.flags.enabled) {
|
||||||
|
|
|
@ -62,25 +62,24 @@ acpi_extract_package(union acpi_object *package,
|
||||||
|
|
||||||
if (!package || (package->type != ACPI_TYPE_PACKAGE)
|
if (!package || (package->type != ACPI_TYPE_PACKAGE)
|
||||||
|| (package->package.count < 1)) {
|
|| (package->package.count < 1)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO, "Invalid package argument"));
|
||||||
"Invalid 'package' argument\n"));
|
|
||||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!format || !format->pointer || (format->length < 1)) {
|
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);
|
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!buffer) {
|
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);
|
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||||
}
|
}
|
||||||
|
|
||||||
format_count = (format->length / sizeof(char)) - 1;
|
format_count = (format->length / sizeof(char)) - 1;
|
||||||
if (format_count > package->package.count) {
|
if (format_count > package->package.count) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO, "Format specifies more objects [%d]"
|
||||||
"Format specifies more objects [%d] than exist in package [%d].",
|
" than exist in package [%d].",
|
||||||
format_count, package->package.count));
|
format_count, package->package.count));
|
||||||
return_ACPI_STATUS(AE_BAD_DATA);
|
return_ACPI_STATUS(AE_BAD_DATA);
|
||||||
}
|
}
|
||||||
|
@ -113,8 +112,9 @@ acpi_extract_package(union acpi_object *package,
|
||||||
tail_offset += sizeof(char *);
|
tail_offset += sizeof(char *);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO, "Invalid package element"
|
||||||
"Invalid package element [%d]: got number, expecing [%c].\n",
|
" [%d]: got number, expecing"
|
||||||
|
" [%c]",
|
||||||
i, format_string[i]));
|
i, format_string[i]));
|
||||||
return_ACPI_STATUS(AE_BAD_DATA);
|
return_ACPI_STATUS(AE_BAD_DATA);
|
||||||
break;
|
break;
|
||||||
|
@ -138,8 +138,9 @@ acpi_extract_package(union acpi_object *package,
|
||||||
tail_offset += sizeof(u8 *);
|
tail_offset += sizeof(u8 *);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
ACPI_WARNING((AE_INFO, "Invalid package element"
|
||||||
"Invalid package element [%d] got string/buffer, expecing [%c].\n",
|
" [%d] got string/buffer,"
|
||||||
|
" expecing [%c]",
|
||||||
i, format_string[i]));
|
i, format_string[i]));
|
||||||
return_ACPI_STATUS(AE_BAD_DATA);
|
return_ACPI_STATUS(AE_BAD_DATA);
|
||||||
break;
|
break;
|
||||||
|
@ -325,7 +326,7 @@ acpi_evaluate_string(acpi_handle handle,
|
||||||
|
|
||||||
*data = kmalloc(element->string.length + 1, GFP_KERNEL);
|
*data = kmalloc(element->string.length + 1, GFP_KERNEL);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Memory allocation error\n"));
|
ACPI_ERROR((AE_INFO, "Memory allocation"));
|
||||||
return_VALUE(-ENOMEM);
|
return_VALUE(-ENOMEM);
|
||||||
}
|
}
|
||||||
memset(*data, 0, element->string.length + 1);
|
memset(*data, 0, element->string.length + 1);
|
||||||
|
@ -367,24 +368,21 @@ acpi_evaluate_reference(acpi_handle handle,
|
||||||
package = (union acpi_object *)buffer.pointer;
|
package = (union acpi_object *)buffer.pointer;
|
||||||
|
|
||||||
if ((buffer.length == 0) || !package) {
|
if ((buffer.length == 0) || !package) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "No return object (len %X ptr %p)",
|
||||||
"No return object (len %X ptr %p)\n",
|
|
||||||
(unsigned)buffer.length, package));
|
(unsigned)buffer.length, package));
|
||||||
status = AE_BAD_DATA;
|
status = AE_BAD_DATA;
|
||||||
acpi_util_eval_error(handle, pathname, status);
|
acpi_util_eval_error(handle, pathname, status);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (package->type != ACPI_TYPE_PACKAGE) {
|
if (package->type != ACPI_TYPE_PACKAGE) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Expecting a [Package], found type %X",
|
||||||
"Expecting a [Package], found type %X\n",
|
|
||||||
package->type));
|
package->type));
|
||||||
status = AE_BAD_DATA;
|
status = AE_BAD_DATA;
|
||||||
acpi_util_eval_error(handle, pathname, status);
|
acpi_util_eval_error(handle, pathname, status);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (!package->package.count) {
|
if (!package->package.count) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "[Package] has zero elements (%p)",
|
||||||
"[Package] has zero elements (%p)\n",
|
|
||||||
package));
|
package));
|
||||||
status = AE_BAD_DATA;
|
status = AE_BAD_DATA;
|
||||||
acpi_util_eval_error(handle, pathname, status);
|
acpi_util_eval_error(handle, pathname, status);
|
||||||
|
@ -404,8 +402,8 @@ acpi_evaluate_reference(acpi_handle handle,
|
||||||
|
|
||||||
if (element->type != ACPI_TYPE_ANY) {
|
if (element->type != ACPI_TYPE_ANY) {
|
||||||
status = AE_BAD_DATA;
|
status = AE_BAD_DATA;
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO,
|
||||||
"Expecting a [Reference] package element, found type %X\n",
|
"Expecting a [Reference] package element, found type %X",
|
||||||
element->type));
|
element->type));
|
||||||
acpi_util_eval_error(handle, pathname, status);
|
acpi_util_eval_error(handle, pathname, status);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -324,7 +324,7 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device,
|
||||||
return_VALUE(status);
|
return_VALUE(status);
|
||||||
obj = (union acpi_object *)buffer.pointer;
|
obj = (union acpi_object *)buffer.pointer;
|
||||||
if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {
|
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;
|
status = -EFAULT;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
@ -399,7 +399,7 @@ acpi_video_device_EDID(struct acpi_video_device *device,
|
||||||
if (obj && obj->type == ACPI_TYPE_BUFFER)
|
if (obj && obj->type == ACPI_TYPE_BUFFER)
|
||||||
*edid = obj;
|
*edid = obj;
|
||||||
else {
|
else {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _DDC data\n"));
|
ACPI_ERROR((AE_INFO, "Invalid _DDC data"));
|
||||||
status = -EFAULT;
|
status = -EFAULT;
|
||||||
kfree(obj);
|
kfree(obj);
|
||||||
}
|
}
|
||||||
|
@ -560,8 +560,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
|
||||||
o = (union acpi_object *)&obj->package.
|
o = (union acpi_object *)&obj->package.
|
||||||
elements[i];
|
elements[i];
|
||||||
if (o->type != ACPI_TYPE_INTEGER) {
|
if (o->type != ACPI_TYPE_INTEGER) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Invalid data"));
|
||||||
"Invalid data\n"));
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
br->levels[count] = (u32) o->integer.value;
|
br->levels[count] = (u32) o->integer.value;
|
||||||
|
@ -904,8 +903,7 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
|
||||||
/* 'info' [R] */
|
/* 'info' [R] */
|
||||||
entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device));
|
entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create 'info' fs entry\n"));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_video_device_info_fops;
|
entry->proc_fops = &acpi_video_device_info_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
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,
|
create_proc_entry("state", S_IFREG | S_IRUGO | S_IWUSR,
|
||||||
acpi_device_dir(device));
|
acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create 'state' fs entry\n"));
|
|
||||||
else {
|
else {
|
||||||
acpi_video_device_state_fops.write = acpi_video_device_write_state;
|
acpi_video_device_state_fops.write = acpi_video_device_write_state;
|
||||||
entry->proc_fops = &acpi_video_device_state_fops;
|
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,
|
create_proc_entry("brightness", S_IFREG | S_IRUGO | S_IWUSR,
|
||||||
acpi_device_dir(device));
|
acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create 'brightness' fs entry\n"));
|
|
||||||
else {
|
else {
|
||||||
acpi_video_device_brightness_fops.write = acpi_video_device_write_brightness;
|
acpi_video_device_brightness_fops.write = acpi_video_device_write_brightness;
|
||||||
entry->proc_fops = &acpi_video_device_brightness_fops;
|
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] */
|
/* 'EDID' [R] */
|
||||||
entry = create_proc_entry("EDID", S_IRUGO, acpi_device_dir(device));
|
entry = create_proc_entry("EDID", S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create 'brightness' fs entry\n"));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_video_device_EDID_fops;
|
entry->proc_fops = &acpi_video_device_EDID_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
entry->data = acpi_driver_data(device);
|
||||||
|
@ -1200,8 +1195,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
|
||||||
/* 'info' [R] */
|
/* 'info' [R] */
|
||||||
entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device));
|
entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create 'info' fs entry\n"));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_video_bus_info_fops;
|
entry->proc_fops = &acpi_video_bus_info_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
entry->data = acpi_driver_data(device);
|
||||||
|
@ -1211,8 +1205,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
|
||||||
/* 'ROM' [R] */
|
/* 'ROM' [R] */
|
||||||
entry = create_proc_entry("ROM", S_IRUGO, acpi_device_dir(device));
|
entry = create_proc_entry("ROM", S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create 'ROM' fs entry\n"));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_video_bus_ROM_fops;
|
entry->proc_fops = &acpi_video_bus_ROM_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
entry->data = acpi_driver_data(device);
|
||||||
|
@ -1223,8 +1216,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
|
||||||
entry =
|
entry =
|
||||||
create_proc_entry("POST_info", S_IRUGO, acpi_device_dir(device));
|
create_proc_entry("POST_info", S_IRUGO, acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create 'POST_info' fs entry\n"));
|
|
||||||
else {
|
else {
|
||||||
entry->proc_fops = &acpi_video_bus_POST_info_fops;
|
entry->proc_fops = &acpi_video_bus_POST_info_fops;
|
||||||
entry->data = acpi_driver_data(device);
|
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,
|
create_proc_entry("POST", S_IFREG | S_IRUGO | S_IRUSR,
|
||||||
acpi_device_dir(device));
|
acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create 'POST' fs entry\n"));
|
|
||||||
else {
|
else {
|
||||||
acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST;
|
acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST;
|
||||||
entry->proc_fops = &acpi_video_bus_POST_fops;
|
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,
|
create_proc_entry("DOS", S_IFREG | S_IRUGO | S_IRUSR,
|
||||||
acpi_device_dir(device));
|
acpi_device_dir(device));
|
||||||
if (!entry)
|
if (!entry)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
return_VALUE(-ENODEV);
|
||||||
"Unable to create 'DOS' fs entry\n"));
|
|
||||||
else {
|
else {
|
||||||
acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS;
|
acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS;
|
||||||
entry->proc_fops = &acpi_video_bus_DOS_fops;
|
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);
|
status = acpi_evaluate_object(video->handle, "_DOD", NULL, &buffer);
|
||||||
if (!ACPI_SUCCESS(status)) {
|
if (!ACPI_SUCCESS(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _DOD\n"));
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _DOD"));
|
||||||
return_VALUE(status);
|
return_VALUE(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
dod = (union acpi_object *)buffer.pointer;
|
dod = (union acpi_object *)buffer.pointer;
|
||||||
if (!dod || (dod->type != ACPI_TYPE_PACKAGE)) {
|
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;
|
status = -EFAULT;
|
||||||
goto out;
|
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];
|
obj = (union acpi_object *)&dod->package.elements[i];
|
||||||
|
|
||||||
if (obj->type != ACPI_TYPE_INTEGER) {
|
if (obj->type != ACPI_TYPE_INTEGER) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_ERROR((AE_INFO, "Invalid _DOD data"));
|
||||||
"Invalid _DOD data\n"));
|
|
||||||
active_device_list[i].value.int_val =
|
active_device_list[i].value.int_val =
|
||||||
ACPI_VIDEO_HEAD_INVALID;
|
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);
|
status = acpi_video_bus_get_one_device(dev, video);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_EXCEPTION((AE_INFO, status, "Cant attach device"));
|
||||||
"Cant attach device\n"));
|
|
||||||
continue;
|
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,
|
status = acpi_remove_notify_handler(device->handle,
|
||||||
ACPI_DEVICE_NOTIFY,
|
ACPI_DEVICE_NOTIFY,
|
||||||
acpi_video_device_notify);
|
acpi_video_device_notify);
|
||||||
if (ACPI_FAILURE(status))
|
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
|
||||||
"Error removing notify handler\n"));
|
|
||||||
|
|
||||||
return_VALUE(0);
|
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,
|
status = acpi_remove_notify_handler(video->handle,
|
||||||
ACPI_DEVICE_NOTIFY,
|
ACPI_DEVICE_NOTIFY,
|
||||||
acpi_video_bus_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_put_devices(video);
|
||||||
acpi_video_bus_remove_fs(device);
|
acpi_video_bus_remove_fs(device);
|
||||||
|
|
Loading…
Reference in a new issue