@@ -35,7 +35,8 @@ static int intel_dsm(acpi_handle handle, int func)
union acpi_object params[4];
union acpi_object *obj;
u32 result;
- int ret = 0;
+ acpi_status status;
+ int ret;
input.count = 4;
input.pointer = params;
@@ -50,10 +51,11 @@ static int intel_dsm(acpi_handle handle, int func)
params[3].package.count = 0;
params[3].package.elements = NULL;
- ret = acpi_evaluate_object(handle, "_DSM", &input, &output);
- if (ret) {
- DRM_DEBUG_DRIVER("failed to evaluate _DSM: %d\n", ret);
- return ret;
+ status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+ if (ACPI_FAILURE(status)) {
+ DRM_DEBUG_DRIVER("failed to evaluate _DSM: %s\n",
+ acpi_format_exception(status));
+ return -EINVAL;
}
obj = (union acpi_object *)output.pointer;
@@ -141,7 +143,8 @@ static void intel_dsm_platform_mux_info(void)
struct acpi_object_list input;
union acpi_object params[4];
union acpi_object *pkg;
- int i, ret;
+ acpi_status status;
+ int i;
input.count = 4;
input.pointer = params;
@@ -156,10 +159,11 @@ static void intel_dsm_platform_mux_info(void)
params[3].package.count = 0;
params[3].package.elements = NULL;
- ret = acpi_evaluate_object(intel_dsm_priv.dhandle, "_DSM", &input,
- &output);
- if (ret) {
- DRM_DEBUG_DRIVER("failed to evaluate _DSM: %d\n", ret);
+ acpi_status = acpi_evaluate_object(intel_dsm_priv.dhandle,
+ "_DSM", &input, &output);
+ if (ACPI_FAILURE(status)) {
+ DRM_DEBUG_DRIVER("failed to evaluate _DSM: %s\n",
+ acpi_format_exception(status));
goto out;
}
@@ -114,15 +114,16 @@ mxm_shadow_dsm(struct nouveau_mxm *mxm, u8 version)
struct acpi_buffer retn = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *obj;
acpi_handle handle;
- int ret;
+ acpi_status status;
handle = ACPI_HANDLE(&device->pdev->dev);
if (!handle)
return false;
- ret = acpi_evaluate_object(handle, "_DSM", &list, &retn);
- if (ret) {
- nv_debug(mxm, "DSM MXMS failed: %d\n", ret);
+ status = acpi_evaluate_object(handle, "_DSM", &list, &retn);
+ if (ACPI_FAILURE(status)) {
+ nv_debug(mxm, "DSM MXMS failed: %s\n",
+ acpi_format_exception(status));
return false;
}
@@ -82,7 +82,8 @@ static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *
struct acpi_object_list input;
union acpi_object params[4];
union acpi_object *obj;
- int i, err;
+ acpi_status status;
+ int i;
char args_buff[4];
input.count = 4;
@@ -101,10 +102,11 @@ static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *
args_buff[i] = (arg >> i * 8) & 0xFF;
params[3].buffer.pointer = args_buff;
- err = acpi_evaluate_object(handle, "_DSM", &input, &output);
- if (err) {
- printk(KERN_INFO "failed to evaluate _DSM: %d\n", err);
- return err;
+ status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+ if (ACPI_FAILURE(status)) {
+ pr_info("failed to evaluate _DSM: %s\n",
+ acpi_format_exception(status));
+ return -EINVAL;
}
obj = (union acpi_object *)output.pointer;
@@ -134,7 +136,7 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
struct acpi_object_list input;
union acpi_object params[4];
union acpi_object *obj;
- int err;
+ acpi_status status;
input.count = 4;
input.pointer = params;
@@ -148,10 +150,11 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
params[3].type = ACPI_TYPE_INTEGER;
params[3].integer.value = arg;
- err = acpi_evaluate_object(handle, "_DSM", &input, &output);
- if (err) {
- printk(KERN_INFO "failed to evaluate _DSM: %d\n", err);
- return err;
+ status = acpi_evaluate_object(handle, "_DSM", &input, &output);
+ if (ACPI_FAILURE(status)) {
+ pr_info("failed to evaluate _DSM: %s\n",
+ acpi_format_exception(status));
+ return -EINVAL;
}
obj = (union acpi_object *)output.pointer;
@@ -213,7 +213,7 @@ dsm_get_label(acpi_handle handle, int func,
union acpi_object *obj;
int len = 0;
- int err;
+ acpi_status status;
input.count = 4;
input.pointer = params;
@@ -228,9 +228,12 @@ dsm_get_label(acpi_handle handle, int func,
params[3].package.count = 0;
params[3].package.elements = NULL;
- err = acpi_evaluate_object(handle, "_DSM", &input, output);
- if (err)
+ status = acpi_evaluate_object(handle, "_DSM", &input, output);
+ if (ACPI_FAILURE(status)) {
+ pr_info("failed to evaluate _DSM: %s\n",
+ acpi_format_exception(status));
return -1;
+ }
obj = (union acpi_object *)output->pointer;