x86/hpet: Use proper hpet device number for MSI allocation
[linux-2.6-block.git] / arch / x86 / kernel / hpet.c
index c47aab35a17ec4ef059721c5fd78103d5c18d7d9..10757d0a3fcf438e43ffbfc634e7daa8dc110a2e 100644 (file)
@@ -577,16 +577,17 @@ static void hpet_msi_capability_lookup(unsigned int start_timer)
                if (!(cfg & HPET_TN_FSB_CAP))
                        continue;
 
+               hdev->flags = 0;
+               if (cfg & HPET_TN_PERIODIC_CAP)
+                       hdev->flags |= HPET_DEV_PERI_CAP;
+               sprintf(hdev->name, "hpet%d", i);
+               hdev->num = i;
+
                irq = hpet_assign_irq(hpet_domain, hdev, hdev->num);
                if (irq <= 0)
                        continue;
 
-               sprintf(hdev->name, "hpet%d", i);
-               hdev->num = i;
                hdev->irq = irq;
-               hdev->flags = 0;
-               if (cfg & HPET_TN_PERIODIC_CAP)
-                       hdev->flags |= HPET_DEV_PERI_CAP;
                hdev->flags |= HPET_DEV_FSB_CAP;
                hdev->flags |= HPET_DEV_VALID;
                num_timers_used++;