aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/uv_time.c
diff options
context:
space:
mode:
authorDimitri Sivanich <sivanich@sgi.com>2009-10-14 10:21:03 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-14 12:27:10 -0400
commitd5991ff297ad2f7e2698eefcd8269df5ecec150f (patch)
tree5178e9d2971deb227c88b877e0d4c0714c29a407 /arch/x86/kernel/uv_time.c
parent8c28de4d011f37b2893ecfcec9a985c0e9bd786f (diff)
x86: UV RTC: Clean up error handling
Cleanup error handling in uv_rtc_setup_clock. Signed-off-by: Dimitri Sivanich <sivanich@sgi.com> LKML-Reference: <20091014142103.GD11048@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/uv_time.c')
-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);