From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 1/3] rtc: abracon: Check obtianed time for validity
Date: Sun, 3 Apr 2016 18:06:31 -0700 [thread overview]
Message-ID: <1459731993-14807-1-git-send-email-andrew.smirnov@gmail.com> (raw)
Check obtianed time for validity before returning it to the caller
the same way other RTC drivers do.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
drivers/rtc/rtc-abracon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-abracon.c b/drivers/rtc/rtc-abracon.c
index b3af990..02de2f1 100644
--- a/drivers/rtc/rtc-abracon.c
+++ b/drivers/rtc/rtc-abracon.c
@@ -59,7 +59,7 @@ static int abracon_get_time(struct rtc_device *rtcdev, struct rtc_time *t)
t->tm_mon = bcd2bin(cp[5]);
t->tm_year = bcd2bin(cp[6]) + 100;
- return 0;
+ return rtc_valid_tm(t);
}
static int abracon_set_time(struct rtc_device *rtcdev, struct rtc_time *t)
@@ -123,4 +123,4 @@ static int __init abracon_init(void)
{
return i2c_driver_register(&abracon_driver);
}
-device_initcall(abracon_init);
\ No newline at end of file
+device_initcall(abracon_init);
--
2.5.5
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2016-04-04 1:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 1:06 Andrey Smirnov [this message]
2016-04-04 1:06 ` [PATCH 2/3] ds1307: Fix a bug in probe() Andrey Smirnov
2016-04-04 1:06 ` [PATCH 3/3] ds1307: Configure ds1341 for lowest power mode Andrey Smirnov
2016-04-05 6:43 ` [PATCH 1/3] rtc: abracon: Check obtianed time for validity Sascha Hauer
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=1459731993-14807-1-git-send-email-andrew.smirnov@gmail.com \
--to=andrew.smirnov@gmail.com \
--cc=barebox@lists.infradead.org \
/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