From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: [PATCH] clocksource: em_sti: fix error return codes in em_sti_probe()
Date: Thu, 29 Jun 2017 23:42:14 -0500 [thread overview]
Message-ID: <20170630044214.GA14004@embeddedgus> (raw)
Propagate the return values of platform_get_irq and
devm_request_irq on failure.
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
drivers/clocksource/em_sti.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/clocksource/em_sti.c b/drivers/clocksource/em_sti.c
index bc48cbf..c4818dd 100644
--- a/drivers/clocksource/em_sti.c
+++ b/drivers/clocksource/em_sti.c
@@ -305,7 +305,7 @@ static int em_sti_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "failed to get irq\n");
- return -EINVAL;
+ return irq;
}
/* map memory, let base point to the STI instance */
@@ -314,11 +314,12 @@ static int em_sti_probe(struct platform_device *pdev)
if (IS_ERR(p->base))
return PTR_ERR(p->base);
- if (devm_request_irq(&pdev->dev, irq, em_sti_interrupt,
+ irq = devm_request_irq(&pdev->dev, irq, em_sti_interrupt,
IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING,
- dev_name(&pdev->dev), p)) {
+ dev_name(&pdev->dev), p);
+ if (irq) {
dev_err(&pdev->dev, "failed to request low IRQ\n");
- return -ENOENT;
+ return irq;
}
/* get hold of clock */
--
2.5.0
next reply other threads:[~2017-06-30 4:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 4:42 Gustavo A. R. Silva [this message]
2017-06-30 5:44 ` [PATCH] clocksource: em_sti: fix error return codes in em_sti_probe() Frans Klaver
2017-06-30 5:51 ` Gustavo A. R. Silva
2017-06-30 6:14 ` [PATCH v2] " Gustavo A. R. Silva
2017-08-01 11:56 ` Daniel Lezcano
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=20170630044214.GA14004@embeddedgus \
--to=garsilva@embeddedor.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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