Skip to content

Commit

Permalink
thermal/drivers/hisi: Fix missing interrupt enablement
Browse files Browse the repository at this point in the history
commit c176b10 upstream.

The interrupt for the temperature threshold is not enabled at the end of the
probe function, enable it after the setup is complete.

On the other side, the irq_enabled is not correctly set as we are checking if
the interrupt is masked where 'yes' means irq_enabled=false.

	irq_get_irqchip_state(data->irq, IRQCHIP_STATE_MASKED,
				&data->irq_enabled);

As we are always enabling the interrupt, it is pointless to check if
the interrupt is masked or not, just set irq_enabled to 'true'.

Signed-off-by: Daniel Lezcano <[email protected]>
Reviewed-by: Leo Yan <[email protected]>
Tested-by: Leo Yan <[email protected]>
Signed-off-by: Eduardo Valentin <[email protected]>
Signed-off-by: Kevin Wangtao <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
dlezcano authored and gregkh committed Dec 25, 2017
1 parent 0da9db5 commit 7254834
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/thermal/hisi_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ static int hisi_thermal_probe(struct platform_device *pdev)
}

hisi_thermal_enable_bind_irq_sensor(data);
irq_get_irqchip_state(data->irq, IRQCHIP_STATE_MASKED,
&data->irq_enabled);
data->irq_enabled = true;

for (i = 0; i < HISI_MAX_SENSORS; ++i) {
ret = hisi_thermal_register_sensor(pdev, data,
Expand All @@ -358,6 +357,8 @@ static int hisi_thermal_probe(struct platform_device *pdev)
hisi_thermal_toggle_sensor(&data->sensors[i], true);
}

enable_irq(data->irq);

return 0;
}

Expand Down

0 comments on commit 7254834

Please sign in to comment.