summaryrefslogtreecommitdiff
path: root/drivers/thermal/broadcom
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2020-01-14 11:06:06 -0800
committerDaniel Lezcano <daniel.lezcano@linaro.org>2020-01-27 11:41:08 +0100
commiteaf7a88d4f4c48efff77e0c66462d152d3334bcc (patch)
treeb6d9e1e0acb46f5a5d1bc346e11dd3f21c529225 /drivers/thermal/broadcom
parentc9a506139b7a772be286c34493792ce1b428e992 (diff)
thermal: brcmstb_thermal: Restructure interrupt registration
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
Diffstat (limited to 'drivers/thermal/broadcom')
-rw-r--r--drivers/thermal/broadcom/brcmstb_thermal.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/thermal/broadcom/brcmstb_thermal.c b/drivers/thermal/broadcom/brcmstb_thermal.c
index 4b328586959f..6ded4b9c53be 100644
--- a/drivers/thermal/broadcom/brcmstb_thermal.c
+++ b/drivers/thermal/broadcom/brcmstb_thermal.c
@@ -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");