diff options
Diffstat (limited to 'arch/sparc/kernel/time_32.c')
-rw-r--r-- | arch/sparc/kernel/time_32.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c index 9c743b1886ff..1060e0672a4b 100644 --- a/arch/sparc/kernel/time_32.c +++ b/arch/sparc/kernel/time_32.c | |||
@@ -85,7 +85,7 @@ int update_persistent_clock(struct timespec now) | |||
85 | 85 | ||
86 | /* | 86 | /* |
87 | * timer_interrupt() needs to keep up the real-time clock, | 87 | * timer_interrupt() needs to keep up the real-time clock, |
88 | * as well as call the "do_timer()" routine every clocktick | 88 | * as well as call the "xtime_update()" routine every clocktick |
89 | */ | 89 | */ |
90 | 90 | ||
91 | #define TICK_SIZE (tick_nsec / 1000) | 91 | #define TICK_SIZE (tick_nsec / 1000) |
@@ -96,14 +96,9 @@ static irqreturn_t timer_interrupt(int dummy, void *dev_id) | |||
96 | profile_tick(CPU_PROFILING); | 96 | profile_tick(CPU_PROFILING); |
97 | #endif | 97 | #endif |
98 | 98 | ||
99 | /* Protect counter clear so that do_gettimeoffset works */ | ||
100 | write_seqlock(&xtime_lock); | ||
101 | |||
102 | clear_clock_irq(); | 99 | clear_clock_irq(); |
103 | 100 | ||
104 | do_timer(1); | 101 | xtime_update(1); |
105 | |||
106 | write_sequnlock(&xtime_lock); | ||
107 | 102 | ||
108 | #ifndef CONFIG_SMP | 103 | #ifndef CONFIG_SMP |
109 | update_process_times(user_mode(get_irq_regs())); | 104 | update_process_times(user_mode(get_irq_regs())); |
@@ -142,7 +137,7 @@ static struct platform_device m48t59_rtc = { | |||
142 | }, | 137 | }, |
143 | }; | 138 | }; |
144 | 139 | ||
145 | static int __devinit clock_probe(struct platform_device *op, const struct of_device_id *match) | 140 | static int __devinit clock_probe(struct platform_device *op) |
146 | { | 141 | { |
147 | struct device_node *dp = op->dev.of_node; | 142 | struct device_node *dp = op->dev.of_node; |
148 | const char *model = of_get_property(dp, "model", NULL); | 143 | const char *model = of_get_property(dp, "model", NULL); |
@@ -150,6 +145,10 @@ static int __devinit clock_probe(struct platform_device *op, const struct of_dev | |||
150 | if (!model) | 145 | if (!model) |
151 | return -ENODEV; | 146 | return -ENODEV; |
152 | 147 | ||
148 | /* Only the primary RTC has an address property */ | ||
149 | if (!of_find_property(dp, "address", NULL)) | ||
150 | return -ENODEV; | ||
151 | |||
153 | m48t59_rtc.resource = &op->resource[0]; | 152 | m48t59_rtc.resource = &op->resource[0]; |
154 | if (!strcmp(model, "mk48t02")) { | 153 | if (!strcmp(model, "mk48t02")) { |
155 | /* Map the clock register io area read-only */ | 154 | /* Map the clock register io area read-only */ |
@@ -169,14 +168,14 @@ static int __devinit clock_probe(struct platform_device *op, const struct of_dev | |||
169 | return 0; | 168 | return 0; |
170 | } | 169 | } |
171 | 170 | ||
172 | static struct of_device_id __initdata clock_match[] = { | 171 | static struct of_device_id clock_match[] = { |
173 | { | 172 | { |
174 | .name = "eeprom", | 173 | .name = "eeprom", |
175 | }, | 174 | }, |
176 | {}, | 175 | {}, |
177 | }; | 176 | }; |
178 | 177 | ||
179 | static struct of_platform_driver clock_driver = { | 178 | static struct platform_driver clock_driver = { |
180 | .probe = clock_probe, | 179 | .probe = clock_probe, |
181 | .driver = { | 180 | .driver = { |
182 | .name = "rtc", | 181 | .name = "rtc", |
@@ -189,7 +188,7 @@ static struct of_platform_driver clock_driver = { | |||
189 | /* Probe for the mostek real time clock chip. */ | 188 | /* Probe for the mostek real time clock chip. */ |
190 | static int __init clock_init(void) | 189 | static int __init clock_init(void) |
191 | { | 190 | { |
192 | return of_register_platform_driver(&clock_driver); | 191 | return platform_driver_register(&clock_driver); |
193 | } | 192 | } |
194 | /* Must be after subsys_initcall() so that busses are probed. Must | 193 | /* Must be after subsys_initcall() so that busses are probed. Must |
195 | * be before device_initcall() because things like the RTC driver | 194 | * be before device_initcall() because things like the RTC driver |
@@ -224,19 +223,15 @@ static void __init sbus_time_init(void) | |||
224 | 223 | ||
225 | btfixup(); | 224 | btfixup(); |
226 | 225 | ||
227 | sparc_init_timers(timer_interrupt); | 226 | sparc_irq_config.init_timers(timer_interrupt); |
228 | } | 227 | } |
229 | 228 | ||
230 | void __init time_init(void) | 229 | void __init time_init(void) |
231 | { | 230 | { |
232 | #ifdef CONFIG_PCI | 231 | if (pcic_present()) |
233 | extern void pci_time_init(void); | ||
234 | if (pcic_present()) { | ||
235 | pci_time_init(); | 232 | pci_time_init(); |
236 | return; | 233 | else |
237 | } | 234 | sbus_time_init(); |
238 | #endif | ||
239 | sbus_time_init(); | ||
240 | } | 235 | } |
241 | 236 | ||
242 | 237 | ||