From 9f9276c34cbbf67fd1b3788f0be326b47fc69123 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 20 Apr 2015 12:37:18 -0600 Subject: dm: rtc: Rename to_tm() to rtc_to_tm() and add error code Rename this function so that it is clear that it is provided by the RTC. Also return an error when it cannot function as expected. This is unlikely to occur since it works for dates since 1752 and many RTCs do not support such old dates. Still it is better to be accurate. Signed-off-by: Simon Glass Acked-by: Heiko Schocher --- net/sntp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net') diff --git a/net/sntp.c b/net/sntp.c index 6422eef72e..d7b9e5563a 100644 --- a/net/sntp.c +++ b/net/sntp.c @@ -68,7 +68,7 @@ static void sntp_handler(uchar *pkt, unsigned dest, struct in_addr sip, */ memcpy(&seconds, &rpktp->transmit_timestamp, sizeof(ulong)); - to_tm(ntohl(seconds) - 2208988800UL + net_ntp_time_offset, &tm); + rtc_to_tm(ntohl(seconds) - 2208988800UL + net_ntp_time_offset, &tm); #if defined(CONFIG_CMD_DATE) rtc_set(&tm); #endif -- cgit v1.2.3