aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/atari/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m68k/atari/time.c')
-rw-r--r--arch/m68k/atari/time.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c
index e0d3c8bfb408..1edde27fa32d 100644
--- a/arch/m68k/atari/time.c
+++ b/arch/m68k/atari/time.c
@@ -20,6 +20,9 @@
20 20
21#include <asm/atariints.h> 21#include <asm/atariints.h>
22 22
23DEFINE_SPINLOCK(rtc_lock);
24EXPORT_SYMBOL_GPL(rtc_lock);
25
23void __init 26void __init
24atari_sched_init(irq_handler_t timer_routine) 27atari_sched_init(irq_handler_t timer_routine)
25{ 28{
@@ -191,13 +194,14 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
191 } 194 }
192 195
193 if (!(ctrl & RTC_DM_BINARY)) { 196 if (!(ctrl & RTC_DM_BINARY)) {
194 BIN_TO_BCD(sec); 197 sec = bin2bcd(sec);
195 BIN_TO_BCD(min); 198 min = bin2bcd(min);
196 BIN_TO_BCD(hour); 199 hour = bin2bcd(hour);
197 BIN_TO_BCD(day); 200 day = bin2bcd(day);
198 BIN_TO_BCD(mon); 201 mon = bin2bcd(mon);
199 BIN_TO_BCD(year); 202 year = bin2bcd(year);
200 if (wday >= 0) BIN_TO_BCD(wday); 203 if (wday >= 0)
204 wday = bin2bcd(wday);
201 } 205 }
202 } 206 }
203 207
@@ -252,13 +256,13 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
252 } 256 }
253 257
254 if (!(ctrl & RTC_DM_BINARY)) { 258 if (!(ctrl & RTC_DM_BINARY)) {
255 BCD_TO_BIN(sec); 259 sec = bcd2bin(sec);
256 BCD_TO_BIN(min); 260 min = bcd2bin(min);
257 BCD_TO_BIN(hour); 261 hour = bcd2bin(hour);
258 BCD_TO_BIN(day); 262 day = bcd2bin(day);
259 BCD_TO_BIN(mon); 263 mon = bcd2bin(mon);
260 BCD_TO_BIN(year); 264 year = bcd2bin(year);
261 BCD_TO_BIN(wday); 265 wday = bcd2bin(wday);
262 } 266 }
263 267
264 if (!(ctrl & RTC_24H)) { 268 if (!(ctrl & RTC_24H)) {
@@ -318,7 +322,7 @@ int atari_tt_set_clock_mmss (unsigned long nowtime)
318 322
319 rtc_minutes = RTC_READ (RTC_MINUTES); 323 rtc_minutes = RTC_READ (RTC_MINUTES);
320 if (!(save_control & RTC_DM_BINARY)) 324 if (!(save_control & RTC_DM_BINARY))
321 BCD_TO_BIN (rtc_minutes); 325 rtc_minutes = bcd2bin(rtc_minutes);
322 326
323 /* Since we're only adjusting minutes and seconds, don't interfere 327 /* Since we're only adjusting minutes and seconds, don't interfere
324 with hour overflow. This avoids messing with unknown time zones 328 with hour overflow. This avoids messing with unknown time zones
@@ -329,8 +333,8 @@ int atari_tt_set_clock_mmss (unsigned long nowtime)
329 { 333 {
330 if (!(save_control & RTC_DM_BINARY)) 334 if (!(save_control & RTC_DM_BINARY))
331 { 335 {
332 BIN_TO_BCD (real_seconds); 336 real_seconds = bin2bcd(real_seconds);
333 BIN_TO_BCD (real_minutes); 337 real_minutes = bin2bcd(real_minutes);
334 } 338 }
335 RTC_WRITE (RTC_SECONDS, real_seconds); 339 RTC_WRITE (RTC_SECONDS, real_seconds);
336 RTC_WRITE (RTC_MINUTES, real_minutes); 340 RTC_WRITE (RTC_MINUTES, real_minutes);