aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/uv_time.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/arch/x86/kernel/uv_time.c b/arch/x86/kernel/uv_time.c
index c6324ad7c0d9..255645084534 100644
--- a/arch/x86/kernel/uv_time.c
+++ b/arch/x86/kernel/uv_time.c
@@ -380,15 +380,12 @@ static __init int uv_rtc_setup_clock(void)
380 if (rc || !uv_rtc_evt_enable) 380 if (rc || !uv_rtc_evt_enable)
381 return rc; 381 return rc;
382 382
383 generic_interrupt_extension = uv_rtc_interrupt;
384
385 /* Setup and register clockevents */ 383 /* Setup and register clockevents */
386 rc = uv_rtc_allocate_timers(); 384 rc = uv_rtc_allocate_timers();
387 if (rc) { 385 if (rc)
388 clocksource_unregister(&clocksource_uv); 386 goto error;
389 generic_interrupt_extension = NULL; 387
390 return rc; 388 generic_interrupt_extension = uv_rtc_interrupt;
391 }
392 389
393 clock_event_device_uv.mult = div_sc(sn_rtc_cycles_per_second, 390 clock_event_device_uv.mult = div_sc(sn_rtc_cycles_per_second,
394 NSEC_PER_SEC, clock_event_device_uv.shift); 391 NSEC_PER_SEC, clock_event_device_uv.shift);
@@ -401,11 +398,19 @@ static __init int uv_rtc_setup_clock(void)
401 398
402 rc = schedule_on_each_cpu(uv_rtc_register_clockevents); 399 rc = schedule_on_each_cpu(uv_rtc_register_clockevents);
403 if (rc) { 400 if (rc) {
404 clocksource_unregister(&clocksource_uv);
405 generic_interrupt_extension = NULL; 401 generic_interrupt_extension = NULL;
406 uv_rtc_deallocate_timers(); 402 uv_rtc_deallocate_timers();
403 goto error;
407 } 404 }
408 405
406 printk(KERN_INFO "UV RTC clockevents registered\n");
407
408 return 0;
409
410error:
411 clocksource_unregister(&clocksource_uv);
412 printk(KERN_INFO "UV RTC clockevents failed rc %d\n", rc);
413
409 return rc; 414 return rc;
410} 415}
411arch_initcall(uv_rtc_setup_clock); 416arch_initcall(uv_rtc_setup_clock);