Skip to content

Commit

Permalink
thermal: rcar: check irq possibility in rcar_thermal_irq_xxx()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kuninori Morimoto authored and Eduardo Valentin committed Jan 7, 2016
1 parent a1ade56 commit ffbcdf8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/thermal/rcar_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ static void _rcar_thermal_irq_ctrl(struct rcar_thermal_priv *priv, int enable)
unsigned long flags;
u32 mask = 0x3 << rcar_id_to_shift(priv); /* enable Rising/Falling */

if (!rcar_has_irq_support(priv))
return;

spin_lock_irqsave(&common->lock, flags);

rcar_thermal_common_bset(common, INTMSK, mask, enable ? 0 : mask);
Expand Down Expand Up @@ -374,8 +377,7 @@ static int rcar_thermal_remove(struct platform_device *pdev)
struct rcar_thermal_priv *priv;

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);
}

Expand Down Expand Up @@ -461,8 +463,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
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);

Expand Down

0 comments on commit ffbcdf8

Please sign in to comment.