summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2023-10-02 16:52:18 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-10-03 15:50:03 +0200
commit553921875ff7bcd5f33eb08afb67fba4e864f646 (patch)
tree7fd4e69a798a52894c1f03e7ba24091985cdb94e
parent9fbdc0504244a3c958a0ef4f0ff7016072553f71 (diff)
ACPI: x86: s2idle: Switch to use acpi_evaluate_dsm_typed()
The acpi_evaluate_dsm_typed() provides a way to check the type of the object evaluated by _DSM call. Use it instead of open coded variant. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/x86/s2idle.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
index 08f7c6708206..7d64e655f1b8 100644
--- a/drivers/acpi/x86/s2idle.c
+++ b/drivers/acpi/x86/s2idle.c
@@ -417,11 +417,10 @@ static int validate_dsm(acpi_handle handle, const char *uuid, int rev, guid_t *d
int ret = -EINVAL;
guid_parse(uuid, dsm_guid);
- obj = acpi_evaluate_dsm(handle, dsm_guid, rev, 0, NULL);
/* Check if the _DSM is present and as expected. */
- if (!obj || obj->type != ACPI_TYPE_BUFFER || obj->buffer.length == 0 ||
- obj->buffer.length > sizeof(u32)) {
+ obj = acpi_evaluate_dsm_typed(handle, dsm_guid, rev, 0, NULL, ACPI_TYPE_BUFFER);
+ if (!obj || obj->buffer.length == 0 || obj->buffer.length > sizeof(u32)) {
acpi_handle_debug(handle,
"_DSM UUID %s rev %d function 0 evaluation failed\n", uuid, rev);
goto out;