summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-04-20 12:37:19 -0600
committerSimon Glass <sjg@chromium.org>2015-05-05 20:58:20 -0600
commit714209832db1064886680b138f1abf9ce235b2c3 (patch)
tree6a786a91f13c0e154fb9f6a3068229ad1d2f5326 /include
parent9f9276c34cbbf67fd1b3788f0be326b47fc69123 (diff)
dm: rtc: Rename mktime() and reduce the number of parameters
Most callers unpack the structure and pass each member. It seems better to pass the whole structure instead, as with the C library. Also add an rtc_ prefix. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'include')
-rw-r--r--include/rtc.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/rtc.h b/include/rtc.h
index 4b7ce6108c..b1a4bf05ec 100644
--- a/include/rtc.h
+++ b/include/rtc.h
@@ -45,9 +45,6 @@ int rtc_get (struct rtc_time *);
int rtc_set (struct rtc_time *);
void rtc_reset (void);
-unsigned long mktime (unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, unsigned int);
-
/**
* rtc_read8() - Read an 8-bit register
*
@@ -110,4 +107,17 @@ int rtc_calc_weekday(struct rtc_time *time);
*/
int rtc_to_tm(int time_t, struct rtc_time *time);
+/**
+ * rtc_mktime() - Convert a broken-out time into a time_t value
+ *
+ * The following fields need to be valid for this function to work:
+ * tm_sec, tm_min, tm_hour, tm_mday, tm_mon, tm_year
+ *
+ * Note that tm_wday and tm_yday are ignored.
+ *
+ * @time: Broken-out time to convert
+ * @return corresponding time_t value, seconds since 1970-01-01 00:00:00
+ */
+unsigned long rtc_mktime(const struct rtc_time *time);
+
#endif /* _RTC_H_ */