[1/3] thermal: rcar_thermal: Always update thermal zone on interrupt
diff mbox series

Message ID 20200310170029.1648996-2-niklas.soderlund+renesas@ragnatech.se
State New
Delegated to: Daniel Lezcano
Headers show
Series
  • thermal: rcar_thermal: Update how temperature is read
Related show

Commit Message

Niklas Söderlund March 10, 2020, 5 p.m. UTC
Since commit a1ade5653804b8eb ("thermal: rcar: check every
rcar_thermal_update_temp() return value") the temperature is always read
in rcar_thermal_get_current_temp() so comparing it before and after
enabling interrupts have little effect. Remove the check and always
update the thermal zone when we get an interrupt that the temperature
have changed.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/thermal/rcar_thermal.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

Geert Uytterhoeven March 11, 2020, 12:38 p.m. UTC | #1
On Tue, Mar 10, 2020 at 6:02 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> Since commit a1ade5653804b8eb ("thermal: rcar: check every
> rcar_thermal_update_temp() return value") the temperature is always read
> in rcar_thermal_get_current_temp() so comparing it before and after
> enabling interrupts have little effect. Remove the check and always
> update the thermal zone when we get an interrupt that the temperature
> have changed.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

Patch
diff mbox series

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 8f1aafa2044e5ba7..f379eb5f8b9ecd14 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -387,28 +387,17 @@  static void _rcar_thermal_irq_ctrl(struct rcar_thermal_priv *priv, int enable)
 static void rcar_thermal_work(struct work_struct *work)
 {
 	struct rcar_thermal_priv *priv;
-	int cctemp, nctemp;
 	int ret;
 
 	priv = container_of(work, struct rcar_thermal_priv, work.work);
 
-	ret = rcar_thermal_get_current_temp(priv, &cctemp);
-	if (ret < 0)
-		return;
-
 	ret = rcar_thermal_update_temp(priv);
 	if (ret < 0)
 		return;
 
 	rcar_thermal_irq_enable(priv);
 
-	ret = rcar_thermal_get_current_temp(priv, &nctemp);
-	if (ret < 0)
-		return;
-
-	if (nctemp != cctemp)
-		thermal_zone_device_update(priv->zone,
-					   THERMAL_EVENT_UNSPECIFIED);
+	thermal_zone_device_update(priv->zone, THERMAL_EVENT_UNSPECIFIED);
 }
 
 static u32 rcar_thermal_had_changed(struct rcar_thermal_priv *priv, u32 status)