#include <linux/acpi.h>
#define ACPI_POWER_METER_NAME "power_meter"
-ACPI_MODULE_NAME(ACPI_POWER_METER_NAME);
#define ACPI_POWER_METER_DEVICE_NAME "Power Meter"
#define ACPI_POWER_METER_CLASS "pwr_meter_resource"
status = acpi_evaluate_integer(resource->acpi_dev->handle, "_GAI",
NULL, &data);
if (ACPI_FAILURE(status)) {
- ACPI_EXCEPTION((AE_INFO, status, "Evaluating _GAI"));
+ acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_GAI",
+ status);
return -ENODEV;
}
mutex_unlock(&resource->lock);
if (ACPI_FAILURE(status)) {
- ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PAI"));
+ acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PAI",
+ status);
return -EINVAL;
}
status = acpi_evaluate_integer(resource->acpi_dev->handle, "_GHL",
NULL, &data);
if (ACPI_FAILURE(status)) {
- ACPI_EXCEPTION((AE_INFO, status, "Evaluating _GHL"));
+ acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_GHL",
+ status);
return -ENODEV;
}
mutex_unlock(&resource->lock);
if (ACPI_FAILURE(status)) {
- ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SHL"));
+ acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_SHL",
+ status);
return -EINVAL;
}
status = acpi_evaluate_integer(resource->acpi_dev->handle, "_PTP",
&args, &data);
if (ACPI_FAILURE(status)) {
- ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTP"));
+ acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PTP",
+ status);
return -EINVAL;
}
status = acpi_evaluate_integer(resource->acpi_dev->handle, "_PMM",
NULL, &data);
if (ACPI_FAILURE(status)) {
- ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PMM"));
+ acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PMM",
+ status);
return -ENODEV;
}
status = acpi_evaluate_object(resource->acpi_dev->handle, "_PMD", NULL,
&buffer);
if (ACPI_FAILURE(status)) {
- ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PMD"));
+ acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PMD",
+ status);
return -ENODEV;
}
status = acpi_evaluate_object(resource->acpi_dev->handle, "_PMC", NULL,
&buffer);
if (ACPI_FAILURE(status)) {
- ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PMC"));
+ acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PMC",
+ status);
return -ENODEV;
}
status = acpi_extract_package(pss, &format, &state);
if (ACPI_FAILURE(status)) {
- ACPI_EXCEPTION((AE_INFO, status, "Invalid data"));
+ dev_err(&resource->acpi_dev->dev, ACPI_POWER_METER_NAME
+ "_PMC package parsing failed: %s\n",
+ acpi_format_exception(status));
res = -EFAULT;
goto end;
}