diff options
author | Radim Krčmář <rkrcmar@redhat.com> | 2016-03-02 22:56:51 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-03-04 09:30:22 +0100 |
commit | ab4c14763b434d48bc7732e475ff4d5b6b9d3e3b (patch) | |
tree | 8e78122b1143715e704226807b7c26110f19febc /arch/x86/kvm/i8254.c | |
parent | KVM: i8254: don't assume layout of kvm_kpit_state (diff) | |
download | linux-ab4c14763b434d48bc7732e475ff4d5b6b9d3e3b.tar.xz linux-ab4c14763b434d48bc7732e475ff4d5b6b9d3e3b.zip |
KVM: i8254: move PIT timer function initialization
We can do it just once.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/i8254.c')
-rw-r--r-- | arch/x86/kvm/i8254.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 964902b33eed..68af4445d51d 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c @@ -348,8 +348,6 @@ static void create_pit_timer(struct kvm_pit *pit, u32 val, int is_period) ps->period = interval; ps->is_periodic = is_period; - ps->timer.function = pit_timer_fn; - kvm_pit_reset_reinject(pit); /* @@ -702,6 +700,7 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm, u32 flags) pit_state = &pit->pit_state; hrtimer_init(&pit_state->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); + pit_state->timer.function = pit_timer_fn; pit_state->irq_ack_notifier.gsi = 0; pit_state->irq_ack_notifier.irq_acked = kvm_pit_ack_irq; |