From: Florian Fainelli <f.fainelli@gmail.com>
To: linux-arm-kernel@lists.infradead.org, daniel.lezcano@linaro.org
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Markus Mayer <mmayer@broadcom.com>,
bcm-kernel-feedback-list@broadcom.com (maintainer:BROADCOM STB
AVS TMON DRIVER), Zhang Rui <rui.zhang@intel.com>,
Eduardo Valentin <edubezval@gmail.com>,
Amit Kucheria <amit.kucheria@verdurent.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
linux-pm@vger.kernel.org (open list:BROADCOM STB AVS TMON DRIVER),
devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND
FLATTENED DEVICE TREE BINDINGS),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v2 5/6] thermal: brcmstb_thermal: Restructure interrupt registration
Date: Wed, 11 Dec 2019 12:31:42 -0800 [thread overview]
Message-ID: <20191211203143.2952-6-f.fainelli@gmail.com> (raw)
In-Reply-To: <20191211203143.2952-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.
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
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 74d94f01b1b9..47b622f33900 100644
--- a/drivers/thermal/broadcom/brcmstb_thermal.c
+++ b/drivers/thermal/broadcom/brcmstb_thermal.c
@@ -348,16 +348,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
next prev parent reply other threads:[~2019-12-11 20:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-11 20:31 [PATCH v2 0/6] brcmstb_thermal updates for new processes Florian Fainelli
2019-12-11 20:31 ` [PATCH v2 1/6] thermal: brcmstb_thermal: Do not use DT coefficients Florian Fainelli
2019-12-11 20:31 ` [PATCH v2 2/6] thermal: brcmstb_thermal: Prepare to support a different process Florian Fainelli
2020-01-09 21:17 ` Daniel Lezcano
2020-01-11 0:37 ` Florian Fainelli
2019-12-11 20:31 ` [PATCH v2 3/6] dt-bindings: thermal: Define BCM7216 thermal sensor compatible Florian Fainelli
2019-12-11 20:31 ` [PATCH v2 4/6] thermal: brcmstb_thermal: Add 16nm process thermal parameters Florian Fainelli
2019-12-11 20:31 ` Florian Fainelli [this message]
2019-12-11 20:31 ` [PATCH v2 6/6] thermal: brcmstb_thermal: Register different ops per process Florian Fainelli
2019-12-26 15:54 ` [PATCH v2 0/6] brcmstb_thermal updates for new processes Florian Fainelli
2020-01-08 18:07 ` 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=20191211203143.2952-6-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=amit.kucheria@verdurent.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=edubezval@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mmayer@broadcom.com \
--cc=robh+dt@kernel.org \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).