Skip to content

Commit

Permalink
thermal: brcmstb_thermal: Restructure interrupt registration
Browse files Browse the repository at this point in the history
If we are successful grabbing the interrupt resource, then register an
interrupt handler, this makes it easier to support the interrupt as
being optional, which is it for 7216.

Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200114190607.29339-6-f.fainelli@gmail.com
  • Loading branch information
Florian Fainelli authored and Daniel Lezcano committed Jan 27, 2020
1 parent c9a5061 commit eaf7a88
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions drivers/thermal/broadcom/brcmstb_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,16 +343,15 @@ static int brcmstb_thermal_probe(struct platform_device *pdev)
priv->thermal = thermal;

irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "could not get IRQ\n");
return irq;
}
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
brcmstb_tmon_irq_thread, IRQF_ONESHOT,
DRV_NAME, priv);
if (ret < 0) {
dev_err(&pdev->dev, "could not request IRQ: %d\n", ret);
return ret;
if (irq >= 0) {
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
brcmstb_tmon_irq_thread,
IRQF_ONESHOT,
DRV_NAME, priv);
if (ret < 0) {
dev_err(&pdev->dev, "could not request IRQ: %d\n", ret);
return ret;
}
}

dev_info(&pdev->dev, "registered AVS TMON of-sensor driver\n");
Expand Down

0 comments on commit eaf7a88

Please sign in to comment.