From: Jeremy Fitzhardinge Date: Tue, 16 Dec 2008 20:32:23 +0000 (-0800) Subject: x86: make sure we really have an hpet mapping before using it X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=39c04b55240342d0742ac48538d3d8c71bfc0a94;p=linux-beck.git x86: make sure we really have an hpet mapping before using it Impact: prepare the hpet code for Xen dom0 booting When booting in Xen dom0, the hpet isn't really accessible, so make sure the mapping is non-NULL before use. Signed-off-by: Jeremy Fitzhardinge Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 84089dc8fd1d..a1f6ed5e1a05 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -834,10 +834,11 @@ static __init int hpet_late_init(void) hpet_address = force_hpet_address; hpet_enable(); - if (!hpet_virt_address) - return -ENODEV; } + if (!hpet_virt_address) + return -ENODEV; + hpet_reserve_platform_timers(hpet_readl(HPET_ID)); for_each_online_cpu(cpu) {