]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/thermal/rcar_thermal.c
thermal: rcar: Use pm_runtime_put() i.s.o. pm_runtime_put_sync()
[mirror_ubuntu-bionic-kernel.git] / drivers / thermal / rcar_thermal.c
index 79a09d02bbca04ce97c1bf621508f3ae46d7d93d..a8ed0e0265ae6575c5c67c2011a5e1b28b259fa9 100644 (file)
@@ -299,12 +299,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;
+       unsigned long cctemp, nctemp;
 
        priv = container_of(work, struct rcar_thermal_priv, work.work);
 
+       rcar_thermal_get_temp(priv->zone, &cctemp);
        rcar_thermal_update_temp(priv);
        rcar_thermal_irq_enable(priv);
-       thermal_zone_device_update(priv->zone);
+
+       rcar_thermal_get_temp(priv->zone, &nctemp);
+       if (nctemp != cctemp)
+               thermal_zone_device_update(priv->zone);
 }
 
 static u32 rcar_thermal_had_changed(struct rcar_thermal_priv *priv, u32 status)
@@ -313,7 +318,7 @@ static u32 rcar_thermal_had_changed(struct rcar_thermal_priv *priv, u32 status)
 
        status = (status >> rcar_id_to_shift(priv)) & 0x3;
 
-       if (status & 0x3) {
+       if (status) {
                dev_dbg(dev, "thermal%d %s%s\n",
                        priv->id,
                        (status & 0x2) ? "Rising " : "",
@@ -465,7 +470,7 @@ error_unregister:
                        rcar_thermal_irq_disable(priv);
        }
 
-       pm_runtime_put_sync(dev);
+       pm_runtime_put(dev);
        pm_runtime_disable(dev);
 
        return ret;
@@ -483,7 +488,7 @@ static int rcar_thermal_remove(struct platform_device *pdev)
                        rcar_thermal_irq_disable(priv);
        }
 
-       pm_runtime_put_sync(dev);
+       pm_runtime_put(dev);
        pm_runtime_disable(dev);
 
        return 0;