All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: daniel.lezcano@linaro.org
Cc: Zhang Rui <rui.zhang@intel.com>, Amit Kucheria <amitk@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	dingsenjie <dingsenjie@yulong.com>,
	Bhaskar Chowdhury <unixbhaskar@gmail.com>,
	linux-pm@vger.kernel.org (open list:THERMAL),
	linux-tegra@vger.kernel.org (open list:TEGRA ARCHITECTURE
	SUPPORT), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 1/2] thermal/drivers/tegra: Remove a pointless call get_thermal_instance()
Date: Thu, 22 Apr 2021 13:34:55 +0200	[thread overview]
Message-ID: <20210422113457.51578-1-daniel.lezcano@linaro.org> (raw)

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


             reply	other threads:[~2021-04-22 11:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 11:34 Daniel Lezcano [this message]
2021-04-22 11:34 ` [PATCH 2/2] thermal/core: Remove unused EXPORT_SYMBOLS Daniel Lezcano
2021-04-22 11:53   ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210422113457.51578-1-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=amitk@kernel.org \
    --cc=dingsenjie@yulong.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=thierry.reding@gmail.com \
    --cc=unixbhaskar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.