mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
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 <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user