From: Devendra Naga <devendra.aaru@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Alessandro Zummo <a.zummo@towertech.it>,
rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org
Cc: Devendra Naga <devendra.aaru@gmail.com>
Subject: [PATCH 1/3] rtc/rtc-88pm80x: assign ret only when rtc_register_driver fails
Date: Wed, 18 Jul 2012 22:10:36 +0530 [thread overview]
Message-ID: <1342629636-12745-1-git-send-email-devendra.aaru@gmail.com> (raw)
At the probe we are assigning ret to return value of PTR_ERR right
after the rtc_register_driver, as we would have done it in the
if (IS_ERR(ptr)) check, since the function fails and goes inside
that case
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
---
drivers/rtc/rtc-88pm80x.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/rtc/rtc-88pm80x.c b/drivers/rtc/rtc-88pm80x.c
index a2f956d..7e050b4 100644
--- a/drivers/rtc/rtc-88pm80x.c
+++ b/drivers/rtc/rtc-88pm80x.c
@@ -314,8 +314,8 @@ static int __devinit pm80x_rtc_probe(struct platform_device *pdev)
info->rtc_dev = rtc_device_register("88pm80x-rtc", &pdev->dev,
&pm80x_rtc_ops, THIS_MODULE);
- ret = PTR_ERR(info->rtc_dev);
if (IS_ERR(info->rtc_dev)) {
+ ret = PTR_ERR(info->rtc_dev);
dev_err(&pdev->dev, "Failed to register RTC device: %d\n", ret);
goto out_rtc;
}
--
1.7.0.4
reply other threads:[~2012-07-18 16:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1342629636-12745-1-git-send-email-devendra.aaru@gmail.com \
--to=devendra.aaru@gmail.com \
--cc=a.zummo@towertech.it \
--cc=akpm@linux-foundation.org \
--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;
as well as URLs for NNTP newsgroup(s).