Skip to contentSkip to conversation

platform/x86: intel/pmc: Switch to use acpi_evaluate_dsm_typed()

PATCH Superseded Andy Shevchenko 2 participants 2 messages Jan 18, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: intel/pmc: 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.

---
 drivers/platform/x86/intel/pmc/tgl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/platform/x86/intel/pmc/tgl.c +3 -3
index e3e50538465d..c245ada849d0 100644
@@ -221,9 +221,9 @@ void pmc_core_get_tgl_lpm_reqs(struct platform_device *pdev)
 
 	guid_parse(ACPI_S0IX_DSM_UUID, &s0ix_dsm_guid);
 
-	out_obj = acpi_evaluate_dsm(adev->handle, &s0ix_dsm_guid, 0,
-				    ACPI_GET_LOW_MODE_REGISTERS, NULL);
-	if (out_obj && out_obj->type == ACPI_TYPE_BUFFER) {
+	out_obj = acpi_evaluate_dsm_typed(adev->handle, &s0ix_dsm_guid, 0,
+					  ACPI_GET_LOW_MODE_REGISTERS, NULL, ACPI_TYPE_BUFFER);
+	if (out_obj) {
 		u32 size = out_obj->buffer.length;
 
 		if (size != lpm_size) {
Signature · 1 line
2.39.0
maintainer Reviewed-by on v1 1/1
#1 lore raw

Looks good.

Quoted 29 lines · Andy Shevchenko

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.

---
 drivers/platform/x86/intel/pmc/tgl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/platform/x86/intel/pmc/tgl.c +3 -4
index e3e50538465d..c245ada849d0 100644
@@ -221,9 +221,9 @@ void pmc_core_get_tgl_lpm_reqs(struct platform_device *pdev)
 
        guid_parse(ACPI_S0IX_DSM_UUID, &s0ix_dsm_guid);
 
-       out_obj = acpi_evaluate_dsm(adev->handle, &s0ix_dsm_guid, 0,
-                                   ACPI_GET_LOW_MODE_REGISTERS, NULL);
-       if (out_obj && out_obj->type == ACPI_TYPE_BUFFER) {
+       out_obj = acpi_evaluate_dsm_typed(adev->handle, &s0ix_dsm_guid, 0,
+                                         ACPI_GET_LOW_MODE_REGISTERS, NULL, ACPI_TYPE_BUFFER);
+       if (out_obj) {
                u32 size = out_obj->buffer.length;
 
                if (size != lpm_size) {
--

2.39.0

Signature · 2 lines
Thanks,
Rajneesh