aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2015-12-14 20:17:56 -0500
committerEduardo Valentin <edubezval@gmail.com>2016-01-06 21:06:38 -0500
commitffbcdf8a759c6dde71c6c4f646a552f7637bcca7 (patch)
treebab124bea2f16dae4a300adeee307361fb6a90fa
parenta1ade5653804b8eb9d14c5ba964da6d5c2f4cd30 (diff)
thermal: rcar: check irq possibility in rcar_thermal_irq_xxx()
Current rcar thermal driver sometimes checks irq possibility when it calls rcar_thermal_irq_enable/disable(), but sometimes not. This patch checks it inside rcar_thermal_irq_enable/disable(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r--drivers/thermal/rcar_thermal.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index b012d900c3f2..fb81fd7e6b81 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -290,6 +290,9 @@ static void _rcar_thermal_irq_ctrl(struct rcar_thermal_priv *priv, int enable)
290 unsigned long flags; 290 unsigned long flags;
291 u32 mask = 0x3 << rcar_id_to_shift(priv); /* enable Rising/Falling */ 291 u32 mask = 0x3 << rcar_id_to_shift(priv); /* enable Rising/Falling */
292 292
293 if (!rcar_has_irq_support(priv))
294 return;
295
293 spin_lock_irqsave(&common->lock, flags); 296 spin_lock_irqsave(&common->lock, flags);
294 297
295 rcar_thermal_common_bset(common, INTMSK, mask, enable ? 0 : mask); 298 rcar_thermal_common_bset(common, INTMSK, mask, enable ? 0 : mask);
@@ -374,8 +377,7 @@ static int rcar_thermal_remove(struct platform_device *pdev)
374 struct rcar_thermal_priv *priv; 377 struct rcar_thermal_priv *priv;
375 378
376 rcar_thermal_for_each_priv(priv, common) { 379 rcar_thermal_for_each_priv(priv, common) {
377 if (rcar_has_irq_support(priv)) 380 rcar_thermal_irq_disable(priv);
378 rcar_thermal_irq_disable(priv);
379 thermal_zone_device_unregister(priv->zone); 381 thermal_zone_device_unregister(priv->zone);
380 } 382 }
381 383
@@ -461,8 +463,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
461 goto error_unregister; 463 goto error_unregister;
462 } 464 }
463 465
464 if (rcar_has_irq_support(priv)) 466 rcar_thermal_irq_enable(priv);
465 rcar_thermal_irq_enable(priv);
466 467
467 list_move_tail(&priv->list, &common->head); 468 list_move_tail(&priv->list, &common->head);
468 469