From: Alexander Shiyan <shc_work@mail.ru>
To: rtc-linux@googlegroups.com
Cc: Alessandro Zummo <a.zummo@towertech.it>,
linux-kernel@vger.kernel.org, Alexander Shiyan <shc_work@mail.ru>
Subject: [PATCH RESEND 3/3] rtc: ds1742: Report to RTC core if retrieved time is invalid
Date: Sat, 17 Aug 2013 10:43:56 +0400 [thread overview]
Message-ID: <1376721836-27153-3-git-send-email-shc_work@mail.ru> (raw)
In-Reply-To: <1376721836-27153-1-git-send-email-shc_work@mail.ru>
Let RTC core decides if the retrieved time is invalid,
instead of processing errors in the driver.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
drivers/rtc/rtc-ds1742.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/rtc/rtc-ds1742.c b/drivers/rtc/rtc-ds1742.c
index 139934f..17b73fd 100644
--- a/drivers/rtc/rtc-ds1742.c
+++ b/drivers/rtc/rtc-ds1742.c
@@ -115,11 +115,7 @@ static int ds1742_rtc_read_time(struct device *dev, struct rtc_time *tm)
/* year is 1900 + tm->tm_year */
tm->tm_year = bcd2bin(year) + bcd2bin(century) * 100 - 1900;
- if (rtc_valid_tm(tm) < 0) {
- dev_err(dev, "retrieved date/time is not valid.\n");
- rtc_time_to_tm(0, tm);
- }
- return 0;
+ return rtc_valid_tm(tm);
}
static const struct rtc_class_ops ds1742_rtc_ops = {
--
1.8.1.5
prev parent reply other threads:[~2013-08-17 6:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-17 6:43 [PATCH RESEND 1/3] rtc: ds1742: Using devm_ioremap_resource() Alexander Shiyan
2013-08-17 6:43 ` [PATCH RESEND 2/3] rtc: ds1742: Remove unused field "rtc" from private structure Alexander Shiyan
2013-08-17 6:43 ` Alexander Shiyan [this message]
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=1376721836-27153-3-git-send-email-shc_work@mail.ru \
--to=shc_work@mail.ru \
--cc=a.zummo@towertech.it \
--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
all inboxes | Powered by JetHome®