summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDimitri Sivanich2009-10-14 16:21:03 +0200
committerIngo Molnar2009-10-14 18:27:10 +0200
commitd5991ff297ad2f7e2698eefcd8269df5ecec150f (patch)
tree5178e9d2971deb227c88b877e0d4c0714c29a407 /arch
parentx86: UV RTC: Add clocksource only boot option (diff)
downloadkernel-qcow2-linux-d5991ff297ad2f7e2698eefcd8269df5ecec150f.tar.gz
kernel-qcow2-linux-d5991ff297ad2f7e2698eefcd8269df5ecec150f.tar.xz
kernel-qcow2-linux-d5991ff297ad2f7e2698eefcd8269df5ecec150f.zip
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')
-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)
if (rc || !uv_rtc_evt_enable)
return rc;
- generic_interrupt_extension = uv_rtc_interrupt;
-
/* Setup and register clockevents */
rc = uv_rtc_allocate_timers();
- if (rc) {
- clocksource_unregister(&clocksource_uv);
- generic_interrupt_extension = NULL;
- return rc;
- }
+ if (rc)
+ goto error;
+
+ generic_interrupt_extension = uv_rtc_interrupt;
clock_event_device_uv.mult = div_sc(sn_rtc_cycles_per_second,
NSEC_PER_SEC, clock_event_device_uv.shift);
@@ -401,11 +398,19 @@ static __init int uv_rtc_setup_clock(void)
rc = schedule_on_each_cpu(uv_rtc_register_clockevents);
if (rc) {
- clocksource_unregister(&clocksource_uv);
generic_interrupt_extension = NULL;
uv_rtc_deallocate_timers();
+ goto error;
}
+ printk(KERN_INFO "UV RTC clockevents registered\n");
+
+ return 0;
+
+error:
+ clocksource_unregister(&clocksource_uv);
+ printk(KERN_INFO "UV RTC clockevents failed rc %d\n", rc);
+
return rc;
}
arch_initcall(uv_rtc_setup_clock);