From: Thierry Reding <thierry.reding@gmail.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
Jon Hunter <jonathanh@nvidia.com>,
linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
linux-tegra@vger.kernel.org
Subject: [PATCH 03/10] thermal: tegra: Constify SoC-specific data
Date: Fri, 14 Apr 2023 14:57:14 +0200 [thread overview]
Message-ID: <20230414125721.1043589-4-thierry.reding@gmail.com> (raw)
In-Reply-To: <20230414125721.1043589-1-thierry.reding@gmail.com>
From: Thierry Reding <treding@nvidia.com>
The SoC-specific parameter structure is read-only data, so consistently
use const to mark it as such.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
drivers/thermal/tegra/soctherm.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index ca39340cd93f..958fa10de516 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -339,7 +339,7 @@ struct tegra_soctherm {
u32 *calib;
struct thermal_zone_device **thermctl_tzs;
- struct tegra_soctherm_soc *soc;
+ const struct tegra_soctherm_soc *soc;
struct soctherm_throt_cfg throt_cfgs[THROTTLE_SIZE];
@@ -2054,19 +2054,15 @@ MODULE_DEVICE_TABLE(of, tegra_soctherm_of_match);
static int tegra_soctherm_probe(struct platform_device *pdev)
{
- const struct of_device_id *match;
struct tegra_soctherm *tegra;
struct thermal_zone_device *z;
struct tsensor_shared_calib shared_calib;
- struct tegra_soctherm_soc *soc;
+ const struct tegra_soctherm_soc *soc;
unsigned int i;
int err;
- match = of_match_node(tegra_soctherm_of_match, pdev->dev.of_node);
- if (!match)
- return -ENODEV;
+ soc = device_get_match_data(&pdev->dev);
- soc = (struct tegra_soctherm_soc *)match->data;
if (soc->num_ttgs > TEGRA124_SOCTHERM_SENSOR_NUM)
return -EINVAL;
@@ -2222,7 +2218,7 @@ static int __maybe_unused soctherm_suspend(struct device *dev)
static int __maybe_unused soctherm_resume(struct device *dev)
{
struct tegra_soctherm *tegra = dev_get_drvdata(dev);
- struct tegra_soctherm_soc *soc = tegra->soc;
+ const struct tegra_soctherm_soc *soc = tegra->soc;
int err, i;
err = soctherm_clk_enable(tegra, true);
--
2.40.0
next prev parent reply other threads:[~2023-04-14 12:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 12:57 [PATCH 00/10] thermal: tegra: Do not register cooling device Thierry Reding
2023-04-14 12:57 ` [PATCH 01/10] dt-bindings: thermal: tegra: Document throttle temperature Thierry Reding
2023-04-14 21:47 ` Krzysztof Kozlowski
2023-04-17 8:59 ` Thierry Reding
2023-04-18 16:13 ` Krzysztof Kozlowski
2023-04-14 12:57 ` [PATCH 02/10] thermal: tegra: Use driver-private data consistently Thierry Reding
2023-04-14 12:57 ` Thierry Reding [this message]
2023-04-14 12:57 ` [PATCH 04/10] thermal: tegra: Do not register cooling device Thierry Reding
2023-04-14 12:57 ` [PATCH 05/10] thermal: tegra: Use unsigned int where appropriate Thierry Reding
2023-04-14 12:57 ` [PATCH 06/10] thermal: tegra: Avoid over-allocation of temporary array Thierry Reding
2023-04-14 12:57 ` [PATCH 07/10] thermal: tegra: Remove gratuitous error assignment Thierry Reding
2023-04-14 12:57 ` [PATCH 08/10] thermal: tegra: Minor stylistic cleanups Thierry Reding
2023-04-14 12:57 ` [PATCH 09/10] arm64: tegra: Rework SOCTHERM on Tegra132 and Tegra210 Thierry Reding
2023-04-17 8:15 ` Daniel Lezcano
2023-04-17 9:06 ` Thierry Reding
2023-04-17 9:15 ` Daniel Lezcano
2023-04-14 12:57 ` [PATCH 10/10] ARM: tegra: Rework SOCTHERM on Tegra124 Thierry Reding
2023-06-19 10:36 ` [PATCH 00/10] thermal: tegra: Do not register cooling device Daniel Lezcano
2023-07-11 8:25 ` Daniel Lezcano
2023-07-11 15:42 ` Thierry Reding
2023-07-12 11:01 ` 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=20230414125721.1043589-4-thierry.reding@gmail.com \
--to=thierry.reding@gmail.com \
--cc=amitk@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=jonathanh@nvidia.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=robh+dt@kernel.org \
--cc=rui.zhang@intel.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