[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <fa2bd92a-f2ae-a671-b537-87c0f3c03dbd@linaro.org>
Date: Tue, 24 Jan 2023 20:57:23 +0100
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Thierry Reding <thierry.reding@...il.com>, Wei Ni <wni@...dia.com>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Jon Hunter <jonathanh@...dia.com>,
Johan Hovold <johan@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
Linux PM mailing list <linux-pm@...r.kernel.org>
Subject: thermal/drivers/tegra: Getting rid of the get_thermal_instance()
usage
Hi,
does anyone know what is the purpose of the get_thermal_instance() usage
in this code:
https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git/tree/drivers/thermal/tegra/soctherm.c?h=thermal/linux-next#n623
The driver is using a function which is reserved for the thermal core.
It should not.
Is the following change ok ?
diff --git a/drivers/thermal/tegra/soctherm.c
b/drivers/thermal/tegra/soctherm.c
index 220873298d77..5f552402d987 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -620,9 +620,8 @@ static int tegra_thermctl_set_trip_temp(struct
thermal_zone_device *tz, int trip
continue;
cdev = ts->throt_cfgs[i].cdev;
- if (get_thermal_instance(tz, cdev, trip_id))
- stc = find_throttle_cfg_by_name(ts, cdev->type);
- else
+ stc = find_throttle_cfg_by_name(ts, cdev->type);
+ if (!stc)
continue;
return throttrip_program(dev, sg, stc, temp);
@@ -768,9 +767,9 @@ static int tegra_soctherm_set_hwtrips(struct device
*dev,
continue;
cdev = ts->throt_cfgs[i].cdev;
- if (get_thermal_instance(tz, cdev, trip))
- stc = find_throttle_cfg_by_name(ts, cdev->type);
- else
+
+ stc = find_throttle_cfg_by_name(ts, cdev->type);
+ if (!stc)
continue;
ret = throttrip_program(dev, sg, stc, temperature);
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Powered by blists - more mailing lists