aboutsummaryrefslogtreecommitdiff
path: root/drivers/platform/surface
diff options
context:
space:
mode:
authorGravatar Andy Shevchenko <andriy.shevchenko@linux.intel.com> 2023-01-18 11:38:23 +0200
committerGravatar Hans de Goede <hdegoede@redhat.com> 2023-02-02 22:48:20 +0100
commitc6d41f66d50a46ee943124f5079ad0282080cfb1 (patch)
treeb7d60cfa467980b85c2578c89e8b6fee7a9d19f7 /drivers/platform/surface
parentplatform/surface: aggregator: Rename top-level request functions to avoid amb... (diff)
downloadlinux-c6d41f66d50a46ee943124f5079ad0282080cfb1.tar.gz
linux-c6d41f66d50a46ee943124f5079ad0282080cfb1.tar.bz2
linux-c6d41f66d50a46ee943124f5079ad0282080cfb1.zip
platform/surface: 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: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20230118093823.39679-1-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/surface')
-rw-r--r--drivers/platform/surface/surface_hotplug.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/platform/surface/surface_hotplug.c b/drivers/platform/surface/surface_hotplug.c
index f004a2495201..7b6d887dccdb 100644
--- a/drivers/platform/surface/surface_hotplug.c
+++ b/drivers/platform/surface/surface_hotplug.c
@@ -101,18 +101,12 @@ static void shps_dsm_notify_irq(struct platform_device *pdev, enum shps_irq_type
param.type = ACPI_TYPE_INTEGER;
param.integer.value = value;
- result = acpi_evaluate_dsm(handle, &shps_dsm_guid, SHPS_DSM_REVISION,
- shps_dsm_fn_for_irq(type), &param);
-
+ result = acpi_evaluate_dsm_typed(handle, &shps_dsm_guid, SHPS_DSM_REVISION,
+ shps_dsm_fn_for_irq(type), &param, ACPI_TYPE_BUFFER);
if (!result) {
dev_err(&pdev->dev, "IRQ notification via DSM failed (irq=%d, gpio=%d)\n",
type, value);
- } else if (result->type != ACPI_TYPE_BUFFER) {
- dev_err(&pdev->dev,
- "IRQ notification via DSM failed: unexpected result type (irq=%d, gpio=%d)\n",
- type, value);
-
} else if (result->buffer.length != 1 || result->buffer.pointer[0] != 0) {
dev_err(&pdev->dev,
"IRQ notification via DSM failed: unexpected result value (irq=%d, gpio=%d)\n",
@@ -121,8 +115,7 @@ static void shps_dsm_notify_irq(struct platform_device *pdev, enum shps_irq_type
mutex_unlock(&sdev->lock[type]);
- if (result)
- ACPI_FREE(result);
+ ACPI_FREE(result);
}
static irqreturn_t shps_handle_irq(int irq, void *data)