diff mbox series

[1/2] thermal/drivers/tegra: Remove a pointless call get_thermal_instance()

Message ID 20210422113457.51578-1-daniel.lezcano@linaro.org
State New
Headers show
Series [1/2] thermal/drivers/tegra: Remove a pointless call get_thermal_instance() | expand

Commit Message

Daniel Lezcano April 22, 2021, 11:34 a.m. UTC
The driver is calling get_thermal_instance() but the lookup can happen
directly. Remove the call to get_thermal_instance().

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

---
 drivers/thermal/tegra/soctherm.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

-- 
2.25.1
diff mbox series

Patch

diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index 8e303e9d1dc0..355fdf32cbc1 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -621,9 +621,8 @@  static int tegra_thermctl_set_trip_temp(void *data, int trip, int temp)
 				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;
 
 			return throttrip_program(dev, sg, stc, temp);
@@ -806,9 +805,8 @@  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);