aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/intel/int3472/discrete.c
diff options
context:
space:
mode:
authorHans de Goede <[email protected]>2025-05-07 18:47:33 +0000
committerIlpo Järvinen <[email protected]>2025-05-08 14:36:00 +0000
commit1e5d088a52c207bcef6a43a6f6ffe162c514ed64 (patch)
treee0310dbe57b00721eff0d5345aba8e02a80c9199 /drivers/platform/x86/intel/int3472/discrete.c
parentplatform/x86: int3472: Move common.h to public includes, symbols to INTEL_INT... (diff)
downloadkernel-1e5d088a52c207bcef6a43a6f6ffe162c514ed64.tar.gz
kernel-1e5d088a52c207bcef6a43a6f6ffe162c514ed64.zip
platform/x86: int3472: Stop using devm_gpiod_get()
The intent is to re-use the INT3472 code for parsing Intel camera sensor GPIOs and mapping them to the sensor for the atomisp driver, which currently has duplicate code. On atomisp devices there is no special INT3472 ACPI device, instead the Intel _DSM to get the GPIO type is part of the ACPI device for the sensor itself. To deal with this the mapping is done from ipu_bridge_init() instead of from a platform-device probe() function, there is no device to tie the lifetime of the gpiod_get() calls done by the INT3472 code to. Switch from devm_gpiod_get() to plain gpiod_get() + explicit gpiod_put() calls, to prepare for the code being re-used in the atomisp driver. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Sakari Ailus <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]>
Diffstat (limited to 'drivers/platform/x86/intel/int3472/discrete.c')
-rw-r--r--drivers/platform/x86/intel/int3472/discrete.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c
index d0938da0a591..808d75e8deda 100644
--- a/drivers/platform/x86/intel/int3472/discrete.c
+++ b/drivers/platform/x86/intel/int3472/discrete.c
@@ -117,7 +117,7 @@ skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472,
return ERR_PTR(ret);
gpiod_add_lookup_table(lookup);
- desc = devm_gpiod_get(int3472->dev, con_id, GPIOD_OUT_LOW);
+ desc = gpiod_get(int3472->dev, con_id, GPIOD_OUT_LOW);
gpiod_remove_lookup_table(lookup);
return desc;
@@ -340,6 +340,10 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
ret = -EINVAL;
break;
}
+
+ if (ret)
+ gpiod_put(gpio);
+
break;
default:
dev_warn(int3472->dev,