diff options
Diffstat (limited to 'arch/mips/lasat')
-rw-r--r-- | arch/mips/lasat/ds1603.c | 5 | ||||
-rw-r--r-- | arch/mips/lasat/sysctl.c | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/arch/mips/lasat/ds1603.c b/arch/mips/lasat/ds1603.c index 52cb1436a12a..c6fd96ff118d 100644 --- a/arch/mips/lasat/ds1603.c +++ b/arch/mips/lasat/ds1603.c | |||
@@ -135,7 +135,7 @@ static void rtc_end_op(void) | |||
135 | lasat_ndelay(1000); | 135 | lasat_ndelay(1000); |
136 | } | 136 | } |
137 | 137 | ||
138 | unsigned long read_persistent_clock(void) | 138 | void read_persistent_clock(struct timespec *ts) |
139 | { | 139 | { |
140 | unsigned long word; | 140 | unsigned long word; |
141 | unsigned long flags; | 141 | unsigned long flags; |
@@ -147,7 +147,8 @@ unsigned long read_persistent_clock(void) | |||
147 | rtc_end_op(); | 147 | rtc_end_op(); |
148 | spin_unlock_irqrestore(&rtc_lock, flags); | 148 | spin_unlock_irqrestore(&rtc_lock, flags); |
149 | 149 | ||
150 | return word; | 150 | ts->tv_sec = word; |
151 | ts->tv_nsec = 0; | ||
151 | } | 152 | } |
152 | 153 | ||
153 | int rtc_mips_set_mmss(unsigned long time) | 154 | int rtc_mips_set_mmss(unsigned long time) |
diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c index 8f88886feb12..3f04d4c406b7 100644 --- a/arch/mips/lasat/sysctl.c +++ b/arch/mips/lasat/sysctl.c | |||
@@ -92,10 +92,12 @@ static int rtctmp; | |||
92 | int proc_dolasatrtc(ctl_table *table, int write, struct file *filp, | 92 | int proc_dolasatrtc(ctl_table *table, int write, struct file *filp, |
93 | void *buffer, size_t *lenp, loff_t *ppos) | 93 | void *buffer, size_t *lenp, loff_t *ppos) |
94 | { | 94 | { |
95 | struct timespec ts; | ||
95 | int r; | 96 | int r; |
96 | 97 | ||
97 | if (!write) { | 98 | if (!write) { |
98 | rtctmp = read_persistent_clock(); | 99 | read_persistent_clock(&ts); |
100 | rtctmp = ts.tv_sec; | ||
99 | /* check for time < 0 and set to 0 */ | 101 | /* check for time < 0 and set to 0 */ |
100 | if (rtctmp < 0) | 102 | if (rtctmp < 0) |
101 | rtctmp = 0; | 103 | rtctmp = 0; |
@@ -134,9 +136,11 @@ int sysctl_lasat_rtc(ctl_table *table, | |||
134 | void *oldval, size_t *oldlenp, | 136 | void *oldval, size_t *oldlenp, |
135 | void *newval, size_t newlen) | 137 | void *newval, size_t newlen) |
136 | { | 138 | { |
139 | struct timespec ts; | ||
137 | int r; | 140 | int r; |
138 | 141 | ||
139 | rtctmp = read_persistent_clock(); | 142 | read_persistent_clock(&ts); |
143 | rtctmp = ts.tv_sec; | ||
140 | if (rtctmp < 0) | 144 | if (rtctmp < 0) |
141 | rtctmp = 0; | 145 | rtctmp = 0; |
142 | r = sysctl_intvec(table, oldval, oldlenp, newval, newlen); | 146 | r = sysctl_intvec(table, oldval, oldlenp, newval, newlen); |