Skip to content

Commit fcf3fb7

Browse files
andy-shevmartinkpetersen
authored andcommitted
scsi: ufs: ufs-pci: 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> Link: https://lore.kernel.org/r/20231002135125.2602895-1-andriy.shevchenko@linux.intel.com Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent e66413f commit fcf3fb7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/ufs/host/ufshcd-pci.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,12 @@ static int __intel_dsm(struct intel_host *intel_host, struct device *dev,
5858
int err = 0;
5959
size_t len;
6060

61-
obj = acpi_evaluate_dsm(ACPI_HANDLE(dev), &intel_dsm_guid, 0, fn, NULL);
61+
obj = acpi_evaluate_dsm_typed(ACPI_HANDLE(dev), &intel_dsm_guid, 0, fn, NULL,
62+
ACPI_TYPE_BUFFER);
6263
if (!obj)
6364
return -EOPNOTSUPP;
6465

65-
if (obj->type != ACPI_TYPE_BUFFER || obj->buffer.length < 1) {
66+
if (obj->buffer.length < 1) {
6667
err = -EINVAL;
6768
goto out;
6869
}

0 commit comments

Comments
 (0)