Commit ffbcdf8a authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Eduardo Valentin

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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
parent a1ade565
...@@ -290,6 +290,9 @@ static void _rcar_thermal_irq_ctrl(struct rcar_thermal_priv *priv, int enable) ...@@ -290,6 +290,9 @@ static void _rcar_thermal_irq_ctrl(struct rcar_thermal_priv *priv, int enable)
unsigned long flags; unsigned long flags;
u32 mask = 0x3 << rcar_id_to_shift(priv); /* enable Rising/Falling */ u32 mask = 0x3 << rcar_id_to_shift(priv); /* enable Rising/Falling */
if (!rcar_has_irq_support(priv))
return;
spin_lock_irqsave(&common->lock, flags); spin_lock_irqsave(&common->lock, flags);
rcar_thermal_common_bset(common, INTMSK, mask, enable ? 0 : mask); rcar_thermal_common_bset(common, INTMSK, mask, enable ? 0 : mask);
...@@ -374,8 +377,7 @@ static int rcar_thermal_remove(struct platform_device *pdev) ...@@ -374,8 +377,7 @@ static int rcar_thermal_remove(struct platform_device *pdev)
struct rcar_thermal_priv *priv; struct rcar_thermal_priv *priv;
rcar_thermal_for_each_priv(priv, common) { rcar_thermal_for_each_priv(priv, common) {
if (rcar_has_irq_support(priv)) rcar_thermal_irq_disable(priv);
rcar_thermal_irq_disable(priv);
thermal_zone_device_unregister(priv->zone); thermal_zone_device_unregister(priv->zone);
} }
...@@ -461,8 +463,7 @@ static int rcar_thermal_probe(struct platform_device *pdev) ...@@ -461,8 +463,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
goto error_unregister; goto error_unregister;
} }
if (rcar_has_irq_support(priv)) rcar_thermal_irq_enable(priv);
rcar_thermal_irq_enable(priv);
list_move_tail(&priv->list, &common->head); list_move_tail(&priv->list, &common->head);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment