[PATCH v8 7/9] thermal/drivers/exynos: Relocate exynos_sensor_ops for forward declatition

Anand Moon linux.amoon at gmail.com
Sat Feb 14 10:19:04 PST 2026


Relocate exynos_set_trips() and exynos_sensor_ops to a different
position in the file to resolve forward declaration dependencies
for register to pointer to thermal_zone_device structure.

Signed-off-by: Anand Moon <linux.amoon at gmail.com>
---
v8: new patch.
---
 drivers/thermal/samsung/exynos_tmu.c | 56 ++++++++++++++--------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index f77abdcdc62b..1d657802a310 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -808,6 +808,34 @@ static void exynos4210_tmu_clear_irqs(struct exynos_tmu_data *data)
 	writel(val_irq, data->base + tmu_intclear);
 }
 
+static int exynos_set_trips(struct thermal_zone_device *tz, int low, int high)
+{
+	struct exynos_tmu_data *data = thermal_zone_device_priv(tz);
+
+	mutex_lock(&data->lock);
+	clk_enable(data->clk);
+
+	if (low > INT_MIN)
+		data->soc_config->tmu_set_low_temp(data, low / MCELSIUS);
+	else
+		data->soc_config->tmu_disable_low(data);
+	if (high < INT_MAX)
+		data->soc_config->tmu_set_high_temp(data, high / MCELSIUS);
+	else
+		data->soc_config->tmu_disable_high(data);
+
+	clk_disable(data->clk);
+	mutex_unlock(&data->lock);
+
+	return 0;
+}
+
+static const struct thermal_zone_device_ops exynos_sensor_ops = {
+	.get_temp = exynos_get_temp,
+	.set_emul_temp = exynos_tmu_set_emulation,
+	.set_trips = exynos_set_trips,
+};
+
 static const struct exynos_tmu_soc_config exynos3250_data = {
 	.soc = SOC_ARCH_EXYNOS3250,
 	.tmu_set_low_temp = exynos4412_tmu_set_low_temp,
@@ -1008,34 +1036,6 @@ static int exynos_map_dt_data(struct platform_device *pdev)
 	return 0;
 }
 
-static int exynos_set_trips(struct thermal_zone_device *tz, int low, int high)
-{
-	struct exynos_tmu_data *data = thermal_zone_device_priv(tz);
-
-	mutex_lock(&data->lock);
-	clk_enable(data->clk);
-
-	if (low > INT_MIN)
-		data->soc_config->tmu_set_low_temp(data, low / MCELSIUS);
-	else
-		data->soc_config->tmu_disable_low(data);
-	if (high < INT_MAX)
-		data->soc_config->tmu_set_high_temp(data, high / MCELSIUS);
-	else
-		data->soc_config->tmu_disable_high(data);
-
-	clk_disable(data->clk);
-	mutex_unlock(&data->lock);
-
-	return 0;
-}
-
-static const struct thermal_zone_device_ops exynos_sensor_ops = {
-	.get_temp = exynos_get_temp,
-	.set_emul_temp = exynos_tmu_set_emulation,
-	.set_trips = exynos_set_trips,
-};
-
 static int exynos_tmu_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-- 
2.50.1




More information about the linux-arm-kernel mailing list