From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Thierry Reding <thierry.reding@gmail.com>, Wei Ni <wni@nvidia.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Jon Hunter <jonathanh@nvidia.com>,
Johan Hovold <johan@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
Linux PM mailing list <linux-pm@vger.kernel.org>
Subject: thermal/drivers/tegra: Getting rid of the get_thermal_instance() usage
Date: Tue, 24 Jan 2023 20:57:23 +0100 [thread overview]
Message-ID: <fa2bd92a-f2ae-a671-b537-87c0f3c03dbd@linaro.org> (raw)
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
next reply other threads:[~2023-01-24 19:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-24 19:57 Daniel Lezcano [this message]
2023-01-26 12:55 ` Thierry Reding
2023-01-26 15:37 ` Daniel Lezcano
2023-02-06 14:50 ` Daniel Lezcano
2023-02-07 12:18 ` Thierry Reding
2023-02-07 12:38 ` Daniel Lezcano
2023-02-07 14:27 ` Thierry Reding
2023-02-10 13:17 ` Daniel Lezcano
2023-02-10 14:09 ` Thierry Reding
2023-02-10 14:36 ` Daniel Lezcano
2023-02-10 15:12 ` Thierry Reding
2023-04-11 10:48 ` Daniel Lezcano
2023-04-11 16:30 ` Thierry Reding
2023-03-08 17:21 ` Daniel Lezcano
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=fa2bd92a-f2ae-a671-b537-87c0f3c03dbd@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=johan@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=rafael@kernel.org \
--cc=thierry.reding@gmail.com \
--cc=wni@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®