From: Nicolas Kaiser <nikai@nikai.net>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org
Subject: [PATCH] drivers/rtc/rtc-jz4740.c: fix error check v2
Date: Wed, 30 Mar 2011 20:27:00 +0200 [thread overview]
Message-ID: <20110330202700.7d8142e8@absol.kitzblitz> (raw)
In-Reply-To: <4D935C56.4060903@metafoo.de>
Checking 'rtc->irq < 0' doesn't work because 'rtc->irq' is unsigned.
v2: return error code from platform_get_irq() instead of -ENOENT.
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
---
drivers/rtc/rtc-jz4740.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c
index b647363..efd9691 100644
--- a/drivers/rtc/rtc-jz4740.c
+++ b/drivers/rtc/rtc-jz4740.c
@@ -220,12 +220,12 @@ static int __devinit jz4740_rtc_probe(struct platform_device *pdev)
if (!rtc)
return -ENOMEM;
- rtc->irq = platform_get_irq(pdev, 0);
- if (rtc->irq < 0) {
- ret = -ENOENT;
+ ret = platform_get_irq(pdev, 0);
+ if (ret < 0) {
dev_err(&pdev->dev, "Failed to get platform irq\n");
goto err_free;
}
+ rtc->irq = ret;
rtc->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!rtc->mem) {
--
1.7.3.4
next prev parent reply other threads:[~2011-03-30 18:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-30 16:12 [PATCH] drivers/rtc/rtc-jz4740.c: fix error check Nicolas Kaiser
2011-03-30 16:37 ` Lars-Peter Clausen
2011-03-30 18:27 ` Nicolas Kaiser [this message]
2011-03-31 14:59 ` [rtc-linux] [PATCH] drivers/rtc/rtc-jz4740.c: fix error check v2 Wan ZongShun
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=20110330202700.7d8142e8@absol.kitzblitz \
--to=nikai@nikai.net \
--cc=a.zummo@towertech.it \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rtc-linux@googlegroups.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
Powered by JetHome