mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 00:32:04 +02:00
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>
This commit is contained in:
@@ -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_ */
|
||||
|
Reference in New Issue
Block a user