Skip to content

Commit af514ca

Browse files
committed
sh: Rename rtc_get/set_time() to avoid RTC_CLASS conflict.
We have a clash with RTC_CLASS over these names, so we change them.. Signed-off-by: Paul Mundt <[email protected]>
1 parent 2991be7 commit af514ca

File tree

8 files changed

+28
-38
lines changed

8 files changed

+28
-38
lines changed

arch/sh/boards/dreamcast/rtc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int aica_rtc_settimeofday(const time_t secs)
7575

7676
void aica_time_init(void)
7777
{
78-
rtc_get_time = aica_rtc_gettimeofday;
79-
rtc_set_time = aica_rtc_settimeofday;
78+
rtc_sh_get_time = aica_rtc_gettimeofday;
79+
rtc_sh_set_time = aica_rtc_settimeofday;
8080
}
8181

arch/sh/boards/landisk/rtc.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,9 @@
1616
#include <linux/time.h>
1717
#include <linux/delay.h>
1818
#include <linux/spinlock.h>
19+
#include <linux/bcd.h>
20+
#include <asm/rtc.h>
1921

20-
#ifndef BCD_TO_BIN
21-
#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
22-
#endif
23-
24-
#ifndef BIN_TO_BCD
25-
#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
26-
#endif
27-
28-
extern void (*rtc_get_time) (struct timespec *);
29-
extern int (*rtc_set_time) (const time_t);
3022
extern spinlock_t rtc_lock;
3123

3224
extern void
@@ -94,9 +86,8 @@ int landisk_rtc_settimeofday(const time_t secs)
9486
return retval;
9587
}
9688

97-
9889
void landisk_time_init(void)
9990
{
100-
rtc_get_time = landisk_rtc_gettimeofday;
101-
rtc_set_time = landisk_rtc_settimeofday;
91+
rtc_sh_get_time = landisk_rtc_gettimeofday;
92+
rtc_sh_set_time = landisk_rtc_settimeofday;
10293
}

arch/sh/boards/mpc1211/rtc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ int mpc1211_rtc_settimeofday(const struct timeval *tv)
130130

131131
void mpc1211_time_init(void)
132132
{
133-
rtc_get_time = mpc1211_rtc_gettimeofday;
134-
rtc_set_time = mpc1211_rtc_settimeofday;
133+
rtc_sh_get_time = mpc1211_rtc_gettimeofday;
134+
rtc_sh_set_time = mpc1211_rtc_settimeofday;
135135
}
136136

arch/sh/boards/sh03/rtc.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
#include <linux/sched.h>
1111
#include <linux/time.h>
1212
#include <linux/bcd.h>
13-
#include <asm/io.h>
1413
#include <linux/rtc.h>
1514
#include <linux/spinlock.h>
15+
#include <asm/io.h>
16+
#include <asm/rtc.h>
1617

1718
#define RTC_BASE 0xb0000000
1819
#define RTC_SEC1 (RTC_BASE + 0)
@@ -34,8 +35,6 @@
3435
#define RTC_BUSY 1
3536
#define RTC_STOP 2
3637

37-
extern void (*rtc_get_time)(struct timespec *);
38-
extern int (*rtc_set_time)(const time_t);
3938
extern spinlock_t rtc_lock;
4039

4140
unsigned long get_cmos_time(void)
@@ -128,6 +127,6 @@ int sh03_rtc_settimeofday(const time_t secs)
128127

129128
void sh03_time_init(void)
130129
{
131-
rtc_get_time = sh03_rtc_gettimeofday;
132-
rtc_set_time = sh03_rtc_settimeofday;
130+
rtc_sh_get_time = sh03_rtc_gettimeofday;
131+
rtc_sh_set_time = sh03_rtc_settimeofday;
133132
}

arch/sh/boards/snapgear/rtc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ void __init secureedge5410_rtc_init(void)
165165
}
166166

167167
if (use_ds1302) {
168-
rtc_get_time = snapgear_rtc_gettimeofday;
169-
rtc_set_time = snapgear_rtc_settimeofday;
168+
rtc_sh_get_time = snapgear_rtc_gettimeofday;
169+
rtc_sh_set_time = snapgear_rtc_settimeofday;
170170
} else {
171-
rtc_get_time = sh_rtc_gettimeofday;
172-
rtc_set_time = sh_rtc_settimeofday;
171+
rtc_sh_get_time = sh_rtc_gettimeofday;
172+
rtc_sh_set_time = sh_rtc_settimeofday;
173173
}
174174

175175
printk("SnapGear RTC: using %s rtc.\n", use_ds1302 ? "ds1302" : "internal");

arch/sh/kernel/time.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ EXPORT_SYMBOL(rtc_lock);
2929
/* XXX: Can we initialize this in a routine somewhere? Dreamcast doesn't want
3030
* these routines anywhere... */
3131
#ifdef CONFIG_SH_RTC
32-
void (*rtc_get_time)(struct timespec *) = sh_rtc_gettimeofday;
33-
int (*rtc_set_time)(const time_t) = sh_rtc_settimeofday;
32+
void (*rtc_sh_get_time)(struct timespec *) = sh_rtc_gettimeofday;
33+
int (*rtc_sh_set_time)(const time_t) = sh_rtc_settimeofday;
3434
#else
35-
void (*rtc_get_time)(struct timespec *);
36-
int (*rtc_set_time)(const time_t);
35+
void (*rtc_sh_get_time)(struct timespec *);
36+
int (*rtc_sh_set_time)(const time_t);
3737
#endif
3838

3939
/*
@@ -135,7 +135,7 @@ void handle_timer_tick(struct pt_regs *regs)
135135
xtime.tv_sec > last_rtc_update + 660 &&
136136
(xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
137137
(xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {
138-
if (rtc_set_time(xtime.tv_sec) == 0)
138+
if (rtc_sh_set_time(xtime.tv_sec) == 0)
139139
last_rtc_update = xtime.tv_sec;
140140
else
141141
/* do it again in 60s */
@@ -193,8 +193,8 @@ void __init time_init(void)
193193

194194
clk_init();
195195

196-
if (rtc_get_time) {
197-
rtc_get_time(&xtime);
196+
if (rtc_sh_get_time) {
197+
rtc_sh_get_time(&xtime);
198198
} else {
199199
xtime.tv_sec = mktime(2000, 1, 1, 0, 0, 0);
200200
xtime.tv_nsec = 0;

arch/sh/kernel/timers/timer-tmu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,17 @@ static unsigned long tmu_timer_get_frequency(void)
132132
ctrl_outl(0xffffffff, TMU0_TCOR);
133133
ctrl_outl(0xffffffff, TMU0_TCNT);
134134

135-
rtc_get_time(&ts2);
135+
rtc_sh_get_time(&ts2);
136136

137137
do {
138-
rtc_get_time(&ts1);
138+
rtc_sh_get_time(&ts1);
139139
} while (ts1.tv_nsec == ts2.tv_nsec && ts1.tv_sec == ts2.tv_sec);
140140

141141
/* actually start the timer */
142142
ctrl_outb(TMU_TSTR_INIT, TMU_TSTR);
143143

144144
do {
145-
rtc_get_time(&ts2);
145+
rtc_sh_get_time(&ts2);
146146
} while (ts1.tv_nsec == ts2.tv_nsec && ts1.tv_sec == ts2.tv_sec);
147147

148148
freq = 0xffffffff - ctrl_inl(TMU0_TCNT);

include/asm-sh/rtc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
extern void sh_rtc_gettimeofday(struct timespec *ts);
99
extern int sh_rtc_settimeofday(const time_t secs);
1010
extern void (*board_time_init)(void);
11-
extern void (*rtc_get_time)(struct timespec *);
12-
extern int (*rtc_set_time)(const time_t);
11+
extern void (*rtc_sh_get_time)(struct timespec *);
12+
extern int (*rtc_sh_set_time)(const time_t);
1313

1414
/* RCR1 Bits */
1515
#define RCR1_CF 0x80 /* Carry Flag */

0 commit comments

Comments
 (0)