Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux...
[muen/linux.git] / drivers / thermal / rcar_thermal.c
index 78f932822d381c9dbc013aee618be56e533baaab..8014a207d8d9b1a97d45378cdf00d6b4730c1788 100644 (file)
@@ -112,6 +112,10 @@ static const struct of_device_id rcar_thermal_dt_ids[] = {
                .compatible = "renesas,rcar-gen2-thermal",
                 .data = &rcar_gen2_thermal,
        },
+       {
+               .compatible = "renesas,thermal-r8a77970",
+               .data = &rcar_gen3_thermal,
+       },
        {
                .compatible = "renesas,thermal-r8a77995",
                .data = &rcar_gen3_thermal,
@@ -434,8 +438,8 @@ static irqreturn_t rcar_thermal_irq(int irq, void *data)
        rcar_thermal_for_each_priv(priv, common) {
                if (rcar_thermal_had_changed(priv, status)) {
                        rcar_thermal_irq_disable(priv);
-                       schedule_delayed_work(&priv->work,
-                                             msecs_to_jiffies(300));
+                       queue_delayed_work(system_freezable_wq, &priv->work,
+                                          msecs_to_jiffies(300));
                }
        }
 
@@ -453,6 +457,7 @@ static int rcar_thermal_remove(struct platform_device *pdev)
 
        rcar_thermal_for_each_priv(priv, common) {
                rcar_thermal_irq_disable(priv);
+               cancel_delayed_work_sync(&priv->work);
                if (priv->chip->use_of_thermal)
                        thermal_remove_hwmon_sysfs(priv->zone);
                else
@@ -492,7 +497,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
        pm_runtime_get_sync(dev);
 
        for (i = 0; i < chip->nirqs; i++) {
-               irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+               irq = platform_get_resource(pdev, IORESOURCE_IRQ, i);
                if (!irq)
                        continue;
                if (!common->base) {