1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- From 7d78bab533eb9aa0e5240e25a204e8f416723ed6 Mon Sep 17 00:00:00 2001
- From: Daniel Lezcano <[email protected]>
- Date: Wed, 1 Mar 2023 21:14:30 +0100
- Subject: [PATCH 07/42] thermal/core: Use the thermal zone 'devdata' accessor
- in thermal located drivers
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- 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.
- [skipped drivers not relevant for mediatek target]
- Signed-off-by: Daniel Lezcano <[email protected]>
- Reviewed-by: Niklas Söderlund <[email protected]> #R-Car
- Acked-by: Mark Brown <[email protected]>
- Reviewed-by: AngeloGioacchino Del Regno <[email protected]> #MediaTek auxadc and lvts
- Reviewed-by: Balsam CHIHI <[email protected]> #Mediatek lvts
- Reviewed-by: Adam Ward <[email protected]> #da9062
- Reviewed-by: Baolin Wang <[email protected]> #spread
- Acked-by: Jernej Skrabec <[email protected]> #sun8i_thermal
- Acked-by: Rafael J. Wysocki <[email protected]>
- Acked-by: Florian Fainelli <[email protected]> #Broadcom
- Reviewed-by: Dhruva Gole <[email protected]> # K3 bandgap
- Acked-by: Linus Walleij <[email protected]>
- Acked-by: Heiko Stuebner <[email protected]> #rockchip
- Reviewed-by: Kunihiko Hayashi <[email protected]> #uniphier
- Signed-off-by: Rafael J. Wysocki <[email protected]>
- ---
- drivers/thermal/mediatek/auxadc_thermal.c | 2 +-
- drivers/thermal/mediatek/lvts_thermal.c | 4 ++--
- 43 files changed, 71 insertions(+), 73 deletions(-)
- --- a/drivers/thermal/mediatek/auxadc_thermal.c
- +++ b/drivers/thermal/mediatek/auxadc_thermal.c
- @@ -763,7 +763,7 @@ static int mtk_thermal_bank_temperature(
-
- static int mtk_read_temp(struct thermal_zone_device *tz, int *temperature)
- {
- - struct mtk_thermal *mt = tz->devdata;
- + struct mtk_thermal *mt = thermal_zone_device_priv(tz);
- int i;
- int tempmax = INT_MIN;
-
- --- a/drivers/thermal/mediatek/lvts_thermal.c
- +++ b/drivers/thermal/mediatek/lvts_thermal.c
- @@ -252,7 +252,7 @@ static u32 lvts_temp_to_raw(int temperat
-
- static int lvts_get_temp(struct thermal_zone_device *tz, int *temp)
- {
- - struct lvts_sensor *lvts_sensor = tz->devdata;
- + struct lvts_sensor *lvts_sensor = thermal_zone_device_priv(tz);
- void __iomem *msr = lvts_sensor->msr;
- u32 value;
-
- @@ -290,7 +290,7 @@ static int lvts_get_temp(struct thermal_
-
- static int lvts_set_trips(struct thermal_zone_device *tz, int low, int high)
- {
- - struct lvts_sensor *lvts_sensor = tz->devdata;
- + struct lvts_sensor *lvts_sensor = thermal_zone_device_priv(tz);
- void __iomem *base = lvts_sensor->base;
- u32 raw_low = lvts_temp_to_raw(low);
- u32 raw_high = lvts_temp_to_raw(high);
|