Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5bfd6435 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Michael Ellerman
Browse files

powerpc: use time64_t in read_persistent_clock



Looking through the remaining users of the deprecated mktime()
function, I found the powerpc rtc handlers, which use it in
place of rtc_tm_to_time64().

To clean this up, I'm changing over the read_persistent_clock()
function to the read_persistent_clock64() variant, and change
all the platform specific handlers along with it.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 2dc20f45
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ struct machdep_calls {

	int		(*set_rtc_time)(struct rtc_time *);
	void		(*get_rtc_time)(struct rtc_time *);
	unsigned long	(*get_boot_time)(void);
	time64_t	(*get_boot_time)(void);
	unsigned char 	(*rtc_read_val)(int addr);
	void		(*rtc_write_val)(int addr, unsigned char val);

+1 −1
Original line number Diff line number Diff line
@@ -328,7 +328,7 @@ extern int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data);
extern int opal_get_sensor_data_u64(u32 sensor_hndl, u64 *sensor_data);

struct rtc_time;
extern unsigned long opal_get_boot_time(void);
extern time64_t opal_get_boot_time(void);
extern void opal_nvram_init(void);
extern void opal_flash_update_init(void);
extern void opal_flash_update_print_message(void);
+1 −1
Original line number Diff line number Diff line
@@ -361,7 +361,7 @@ extern int rtas_offline_cpus_mask(cpumask_var_t cpus);
extern int rtas_ibm_suspend_me(u64 handle);

struct rtc_time;
extern unsigned long rtas_get_boot_time(void);
extern time64_t rtas_get_boot_time(void);
extern void rtas_get_rtc_time(struct rtc_time *rtc_time);
extern int rtas_set_rtc_time(struct rtc_time *rtc_time);

+2 −2
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@

#define MAX_RTC_WAIT 5000	/* 5 sec */
#define RTAS_CLOCK_BUSY (-2)
unsigned long __init rtas_get_boot_time(void)
time64_t __init rtas_get_boot_time(void)
{
	int ret[8];
	int error;
@@ -38,7 +38,7 @@ unsigned long __init rtas_get_boot_time(void)
		return 0;
	}

	return mktime(ret[0], ret[1], ret[2], ret[3], ret[4], ret[5]);
	return mktime64(ret[0], ret[1], ret[2], ret[3], ret[4], ret[5]);
}

/* NOTE: get_rtc_time will get an error if executed in interrupt context
+3 −4
Original line number Diff line number Diff line
@@ -825,7 +825,7 @@ int update_persistent_clock(struct timespec now)
	return ppc_md.set_rtc_time(&tm);
}

static void __read_persistent_clock(struct timespec *ts)
static void __read_persistent_clock(struct timespec64 *ts)
{
	struct rtc_time tm;
	static int first = 1;
@@ -849,11 +849,10 @@ static void __read_persistent_clock(struct timespec *ts)
	}
	ppc_md.get_rtc_time(&tm);

	ts->tv_sec = mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
			    tm.tm_hour, tm.tm_min, tm.tm_sec);
	ts->tv_sec = rtc_tm_to_time64(&tm);
}

void read_persistent_clock(struct timespec *ts)
void read_persistent_clock64(struct timespec64 *ts)
{
	__read_persistent_clock(ts);

Loading