Commit d5991ff2 authored by Dimitri Sivanich's avatar Dimitri Sivanich Committed by Ingo Molnar

x86: UV RTC: Clean up error handling

Cleanup error handling in uv_rtc_setup_clock.
Signed-off-by: default avatarDimitri Sivanich <sivanich@sgi.com>
LKML-Reference: <20091014142103.GD11048@sgi.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 8c28de4d
...@@ -380,15 +380,12 @@ static __init int uv_rtc_setup_clock(void) ...@@ -380,15 +380,12 @@ static __init int uv_rtc_setup_clock(void)
if (rc || !uv_rtc_evt_enable) if (rc || !uv_rtc_evt_enable)
return rc; return rc;
generic_interrupt_extension = uv_rtc_interrupt;
/* Setup and register clockevents */ /* Setup and register clockevents */
rc = uv_rtc_allocate_timers(); rc = uv_rtc_allocate_timers();
if (rc) { if (rc)
clocksource_unregister(&clocksource_uv); goto error;
generic_interrupt_extension = NULL;
return rc; generic_interrupt_extension = uv_rtc_interrupt;
}
clock_event_device_uv.mult = div_sc(sn_rtc_cycles_per_second, clock_event_device_uv.mult = div_sc(sn_rtc_cycles_per_second,
NSEC_PER_SEC, clock_event_device_uv.shift); NSEC_PER_SEC, clock_event_device_uv.shift);
...@@ -401,11 +398,19 @@ static __init int uv_rtc_setup_clock(void) ...@@ -401,11 +398,19 @@ static __init int uv_rtc_setup_clock(void)
rc = schedule_on_each_cpu(uv_rtc_register_clockevents); rc = schedule_on_each_cpu(uv_rtc_register_clockevents);
if (rc) { if (rc) {
clocksource_unregister(&clocksource_uv);
generic_interrupt_extension = NULL; generic_interrupt_extension = NULL;
uv_rtc_deallocate_timers(); 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; return rc;
} }
arch_initcall(uv_rtc_setup_clock); arch_initcall(uv_rtc_setup_clock);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment