public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail•com>
To: linux-kernel@vger•kernel.org
Cc: Mark Rutland <mark.rutland@arm•com>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger•kernel.org>,
	Amit Kucheria <amit.kucheria@verdurent•com>,
	Florian Fainelli <f.fainelli@gmail•com>,
	"open list:BROADCOM STB AVS TMON DRIVER"
	<linux-pm@vger•kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro•org>,
	Eduardo Valentin <edubezval@gmail•com>,
	Rob Herring <robh+dt@kernel•org>,
	"maintainer:BROADCOM STB AVS TMON DRIVER"
	<bcm-kernel-feedback-list@broadcom•com>,
	Markus Mayer <mmayer@broadcom•com>,
	Zhang Rui <rui.zhang@intel•com>,
	"moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE"
	<linux-arm-kernel@lists•infradead.org>
Subject: [PATCH 5/6] thermal: brcmstb_thermal: Restructure interrupt registration
Date: Wed, 30 Oct 2019 11:21:31 -0700	[thread overview]
Message-ID: <20191030182132.25763-6-f.fainelli@gmail.com> (raw)
In-Reply-To: <20191030182132.25763-1-f.fainelli@gmail.com>

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.

Signed-off-by: Florian Fainelli <f.fainelli@gmail•com>
---
 drivers/thermal/broadcom/brcmstb_thermal.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/thermal/broadcom/brcmstb_thermal.c b/drivers/thermal/broadcom/brcmstb_thermal.c
index 41d4a142707c..64f715053ce9 100644
--- a/drivers/thermal/broadcom/brcmstb_thermal.c
+++ b/drivers/thermal/broadcom/brcmstb_thermal.c
@@ -339,16 +339,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");
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-10-30 18:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30 18:21 [PATCH 0/6] brcmstb_thermal updates for new processes Florian Fainelli
2019-10-30 18:21 ` [PATCH 1/6] thermal: brcmstb_thermal: Do not use DT coefficients Florian Fainelli
2019-12-04  8:41   ` Amit Kucheria
2019-12-04 17:41     ` Florian Fainelli
2019-12-04 19:01       ` Amit Kucheria
2019-10-30 18:21 ` [PATCH 2/6] thermal: brcmstb_thermal: Prepare to support a different process Florian Fainelli
2019-10-30 18:21 ` [PATCH 3/6] dt-bindings: thermal: Define BCM7216 thermal sensor compatible Florian Fainelli
2019-11-06  3:55   ` Rob Herring
2019-10-30 18:21 ` [PATCH 4/6] thermal: brcmstb_thermal: Add 16nm process thermal parameters Florian Fainelli
2019-12-04  8:43   ` Amit Kucheria
2019-10-30 18:21 ` Florian Fainelli [this message]
2019-12-04  9:38   ` [PATCH 5/6] thermal: brcmstb_thermal: Restructure interrupt registration Amit Kucheria
2019-10-30 18:21 ` [PATCH 6/6] thermal: brcmstb_thermal: Register different ops per process Florian Fainelli
2019-12-04  9:38   ` Amit Kucheria
2019-11-20 18:43 ` [PATCH 0/6] brcmstb_thermal updates for new processes Florian Fainelli
2019-12-04  4:50   ` Florian Fainelli
2019-12-09  9:04     ` Daniel Lezcano
2019-12-09 17:36       ` Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191030182132.25763-6-f.fainelli@gmail.com \
    --to=f.fainelli@gmail$(echo .)com \
    --cc=amit.kucheria@verdurent$(echo .)com \
    --cc=bcm-kernel-feedback-list@broadcom$(echo .)com \
    --cc=daniel.lezcano@linaro$(echo .)org \
    --cc=devicetree@vger$(echo .)kernel.org \
    --cc=edubezval@gmail$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-pm@vger$(echo .)kernel.org \
    --cc=mark.rutland@arm$(echo .)com \
    --cc=mmayer@broadcom$(echo .)com \
    --cc=robh+dt@kernel$(echo .)org \
    --cc=rui.zhang@intel$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox