diff mbox series

[v2,01/13] media: atomisp_gmin_platform: Switch to use acpi_evaluate_dsm_typed()

Message ID 20220822150610.45186-1-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show
Series [v2,01/13] media: atomisp_gmin_platform: Switch to use acpi_evaluate_dsm_typed() | expand

Commit Message

Hans de Goede Aug. 22, 2022, 3:05 p.m. UTC
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://lore.kernel.org/r/20220730155905.90091-1-andriy.shevchenko@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Andy Shevchenko Aug. 22, 2022, 9:28 p.m. UTC | #1
On Mon, Aug 22, 2022 at 6:06 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> 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.

of an open

...

Hmm... I thought I gave the Rb tag for patches 2-11.
In this version patches 12 and 13 also look good to me.
Hans de Goede Aug. 29, 2022, 10:18 a.m. UTC | #2
Hi,

On 8/22/22 23:28, Andy Shevchenko wrote:
> On Mon, Aug 22, 2022 at 6:06 PM Hans de Goede <hdegoede@redhat.com> wrote:
>>
>> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>
>> 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.
> 
> of an open
> 
> ...
> 
> Hmm... I thought I gave the Rb tag for patches 2-11.

Yes you did I forgot to add that, sorry. I have added it in my local tree now.

> In this version patches 12 and 13 also look good to me.

Thanks, also added in my local tree (I plan to send a v3 with more cleanups
added on top).

Regards,

Hans
diff mbox series

Patch

diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
index 133d7d56fff2..648469de2cdc 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
@@ -1250,16 +1250,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];