linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] thermal/drivers/tegra: Remove a pointless call get_thermal_instance()
@ 2021-04-22 11:34 Daniel Lezcano
  2021-04-22 11:34 ` [PATCH 2/2] thermal/core: Remove unused EXPORT_SYMBOLS Daniel Lezcano
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Lezcano @ 2021-04-22 11:34 UTC (permalink / raw)
  To: daniel.lezcano
  Cc: Zhang Rui, Amit Kucheria, Thierry Reding, Jonathan Hunter,
	dingsenjie, Bhaskar Chowdhury, open list:THERMAL,
	open list:TEGRA ARCHITECTURE SUPPORT, open list

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(-)

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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-22 11:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-22 11:34 [PATCH 1/2] thermal/drivers/tegra: Remove a pointless call get_thermal_instance() Daniel Lezcano
2021-04-22 11:34 ` [PATCH 2/2] thermal/core: Remove unused EXPORT_SYMBOLS Daniel Lezcano
2021-04-22 11:53   ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).