diff options
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/boards/mpc1211/rtc.c | 9 | ||||
-rw-r--r-- | arch/sh/boards/sh03/rtc.c | 9 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/rtc.c | 10 |
3 files changed, 3 insertions, 25 deletions
diff --git a/arch/sh/boards/mpc1211/rtc.c b/arch/sh/boards/mpc1211/rtc.c index 8ae2dc11d8e5..a76c655dceee 100644 --- a/arch/sh/boards/mpc1211/rtc.c +++ b/arch/sh/boards/mpc1211/rtc.c | |||
@@ -9,16 +9,9 @@ | |||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/sched.h> | 10 | #include <linux/sched.h> |
11 | #include <linux/time.h> | 11 | #include <linux/time.h> |
12 | #include <linux/bcd.h> | ||
12 | #include <linux/mc146818rtc.h> | 13 | #include <linux/mc146818rtc.h> |
13 | 14 | ||
14 | #ifndef BCD_TO_BIN | ||
15 | #define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10) | ||
16 | #endif | ||
17 | |||
18 | #ifndef BIN_TO_BCD | ||
19 | #define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10) | ||
20 | #endif | ||
21 | |||
22 | unsigned long get_cmos_time(void) | 15 | unsigned long get_cmos_time(void) |
23 | { | 16 | { |
24 | unsigned int year, mon, day, hour, min, sec; | 17 | unsigned int year, mon, day, hour, min, sec; |
diff --git a/arch/sh/boards/sh03/rtc.c b/arch/sh/boards/sh03/rtc.c index e8bec67be84d..d609863cfe53 100644 --- a/arch/sh/boards/sh03/rtc.c +++ b/arch/sh/boards/sh03/rtc.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/sched.h> | 10 | #include <linux/sched.h> |
11 | #include <linux/time.h> | 11 | #include <linux/time.h> |
12 | #include <linux/bcd.h> | ||
12 | #include <asm/io.h> | 13 | #include <asm/io.h> |
13 | #include <linux/rtc.h> | 14 | #include <linux/rtc.h> |
14 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
@@ -33,14 +34,6 @@ | |||
33 | #define RTC_BUSY 1 | 34 | #define RTC_BUSY 1 |
34 | #define RTC_STOP 2 | 35 | #define RTC_STOP 2 |
35 | 36 | ||
36 | #ifndef BCD_TO_BIN | ||
37 | #define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10) | ||
38 | #endif | ||
39 | |||
40 | #ifndef BIN_TO_BCD | ||
41 | #define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10) | ||
42 | #endif | ||
43 | |||
44 | extern void (*rtc_get_time)(struct timespec *); | 37 | extern void (*rtc_get_time)(struct timespec *); |
45 | extern int (*rtc_set_time)(const time_t); | 38 | extern int (*rtc_set_time)(const time_t); |
46 | extern spinlock_t rtc_lock; | 39 | extern spinlock_t rtc_lock; |
diff --git a/arch/sh/kernel/cpu/rtc.c b/arch/sh/kernel/cpu/rtc.c index f8361f5e788b..4304cf75cfa2 100644 --- a/arch/sh/kernel/cpu/rtc.c +++ b/arch/sh/kernel/cpu/rtc.c | |||
@@ -9,18 +9,10 @@ | |||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/sched.h> | 10 | #include <linux/sched.h> |
11 | #include <linux/time.h> | 11 | #include <linux/time.h> |
12 | 12 | #include <linux/bcd.h> | |
13 | #include <asm/io.h> | 13 | #include <asm/io.h> |
14 | #include <asm/rtc.h> | 14 | #include <asm/rtc.h> |
15 | 15 | ||
16 | #ifndef BCD_TO_BIN | ||
17 | #define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10) | ||
18 | #endif | ||
19 | |||
20 | #ifndef BIN_TO_BCD | ||
21 | #define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10) | ||
22 | #endif | ||
23 | |||
24 | void sh_rtc_gettimeofday(struct timespec *ts) | 16 | void sh_rtc_gettimeofday(struct timespec *ts) |
25 | { | 17 | { |
26 | unsigned int sec128, sec, sec2, min, hr, wk, day, mon, yr, yr100, cf_bit; | 18 | unsigned int sec128, sec, sec2, min, hr, wk, day, mon, yr, yr100, cf_bit; |