x86: make sure we really have an hpet mapping before using it
authorJeremy Fitzhardinge <jeremy@goop.org>
Tue, 16 Dec 2008 20:32:23 +0000 (12:32 -0800)
committerIngo Molnar <mingo@elte.hu>
Tue, 16 Dec 2008 21:01:46 +0000 (22:01 +0100)
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 <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/hpet.c

index 84089dc8fd1de4186452a04d5e0a3770cdf8c2fa..a1f6ed5e1a05b0a5305dc6c15a92b65682aebf25 100644 (file)
@@ -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) {