Skip to content

Commit eaf7a88

Browse files
ffainellidlezcano
authored andcommitted
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 <[email protected]> Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c9a5061 commit eaf7a88

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

drivers/thermal/broadcom/brcmstb_thermal.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -343,16 +343,15 @@ static int brcmstb_thermal_probe(struct platform_device *pdev)
343343
priv->thermal = thermal;
344344

345345
irq = platform_get_irq(pdev, 0);
346-
if (irq < 0) {
347-
dev_err(&pdev->dev, "could not get IRQ\n");
348-
return irq;
349-
}
350-
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
351-
brcmstb_tmon_irq_thread, IRQF_ONESHOT,
352-
DRV_NAME, priv);
353-
if (ret < 0) {
354-
dev_err(&pdev->dev, "could not request IRQ: %d\n", ret);
355-
return ret;
346+
if (irq >= 0) {
347+
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
348+
brcmstb_tmon_irq_thread,
349+
IRQF_ONESHOT,
350+
DRV_NAME, priv);
351+
if (ret < 0) {
352+
dev_err(&pdev->dev, "could not request IRQ: %d\n", ret);
353+
return ret;
354+
}
356355
}
357356

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

0 commit comments

Comments
 (0)