Commit a25a64b5 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mauro Carvalho Chehab
Browse files

media: atomisp_gmin_platform: 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.

Link: https://lore.kernel.org/r/20220730155905.90091-1-andriy.shevchenko@linux.intel.com



Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent b53ad425
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -1207,16 +1207,14 @@ static int gmin_get_config_dsm_var(struct device *dev,
	if (!strcmp(var, "CamClk"))
		return -EINVAL;

	obj = acpi_evaluate_dsm(handle, &atomisp_dsm_guid, 0, 0, NULL);
	/* Return on unexpected object type */
	obj = acpi_evaluate_dsm_typed(handle, &atomisp_dsm_guid, 0, 0, NULL,
				      ACPI_TYPE_PACKAGE);
	if (!obj) {
		dev_info_once(dev, "Didn't find ACPI _DSM table.\n");
		return -EINVAL;
	}

	/* Return on unexpected object type */
	if (obj->type != ACPI_TYPE_PACKAGE)
		return -EINVAL;

#if 0 /* Just for debugging purposes */
	for (i = 0; i < obj->package.count; i++) {
		union acpi_object *cur = &obj->package.elements[i];