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>
diff --git a/drivers/rtc/mxsrtc.c b/drivers/rtc/mxsrtc.c
index 32ba8a3..82c2fbf 100644
--- a/drivers/rtc/mxsrtc.c
+++ b/drivers/rtc/mxsrtc.c
@@ -43,7 +43,7 @@
 	uint32_t secs;
 
 	secs = readl(&rtc_regs->hw_rtc_seconds);
-	to_tm(secs, time);
+	rtc_to_tm(secs, time);
 
 	return 0;
 }