summaryrefslogtreecommitdiff
path: root/drivers/thermal/spear_thermal.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2023-03-01 23:14:30 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-03-03 22:45:02 +0300
commit5f68d0785e5258ab5e6df9e351929973a0742c1a (patch)
tree2fbb599f394013dcc8b10d32fa0ecd9c90a3b269 /drivers/thermal/spear_thermal.c
parenta6ff3c0021468721b96e84892a8cae24bde8d65f (diff)
downloadlinux-5f68d0785e5258ab5e6df9e351929973a0742c1a.tar.xz
thermal/core: Use the thermal zone 'devdata' accessor in thermal located drivers
The thermal zone device structure is exposed to the different drivers and obviously they access the internals while that should be restricted to the core thermal code. In order to self-encapsulate the thermal core code, we need to prevent the drivers accessing directly the thermal zone structure and provide accessor functions to deal with. Use the devdata accessor introduced in the previous patch. No functional changes intended. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> #R-Car Acked-by: Mark Brown <broonie@kernel.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> #MediaTek auxadc and lvts Reviewed-by: Balsam CHIHI <bchihi@baylibre.com> #Mediatek lvts Reviewed-by: Adam Ward <DLG-Adam.Ward.opensource@dm.renesas.com> #da9062 Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> #spread Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> #sun8i_thermal Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> #Broadcom Reviewed-by: Dhruva Gole <d-gole@ti.com> # K3 bandgap Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Heiko Stuebner <heiko@sntech.de> #rockchip Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> #uniphier Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/thermal/spear_thermal.c')
-rw-r--r--drivers/thermal/spear_thermal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
index 6a722b10d738..653439b965c8 100644
--- a/drivers/thermal/spear_thermal.c
+++ b/drivers/thermal/spear_thermal.c
@@ -31,7 +31,7 @@ struct spear_thermal_dev {
static inline int thermal_get_temp(struct thermal_zone_device *thermal,
int *temp)
{
- struct spear_thermal_dev *stdev = thermal->devdata;
+ struct spear_thermal_dev *stdev = thermal_zone_device_priv(thermal);
/*
* Data are ready to be read after 628 usec from POWERDOWN signal
@@ -48,7 +48,7 @@ static struct thermal_zone_device_ops ops = {
static int __maybe_unused spear_thermal_suspend(struct device *dev)
{
struct thermal_zone_device *spear_thermal = dev_get_drvdata(dev);
- struct spear_thermal_dev *stdev = spear_thermal->devdata;
+ struct spear_thermal_dev *stdev = thermal_zone_device_priv(spear_thermal);
unsigned int actual_mask = 0;
/* Disable SPEAr Thermal Sensor */
@@ -64,7 +64,7 @@ static int __maybe_unused spear_thermal_suspend(struct device *dev)
static int __maybe_unused spear_thermal_resume(struct device *dev)
{
struct thermal_zone_device *spear_thermal = dev_get_drvdata(dev);
- struct spear_thermal_dev *stdev = spear_thermal->devdata;
+ struct spear_thermal_dev *stdev = thermal_zone_device_priv(spear_thermal);
unsigned int actual_mask = 0;
int ret = 0;
@@ -154,7 +154,7 @@ static int spear_thermal_exit(struct platform_device *pdev)
{
unsigned int actual_mask = 0;
struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev);
- struct spear_thermal_dev *stdev = spear_thermal->devdata;
+ struct spear_thermal_dev *stdev = thermal_zone_device_priv(spear_thermal);
thermal_zone_device_unregister(spear_thermal);