Commit eaf7a88d authored by Florian Fainelli's avatar Florian Fainelli Committed by Daniel Lezcano
Browse files

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: default avatarAmit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200114190607.29339-6-f.fainelli@gmail.com
parent c9a50613
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
@@ -343,17 +343,16 @@ 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;
	}
	if (irq >= 0) {
		ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
					brcmstb_tmon_irq_thread, IRQF_ONESHOT,
						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");