x86/irq: Probe for PIC presence before allocating descs for legacy IRQs
[firefly-linux-kernel-4.4.55.git] / arch / x86 / kernel / apic / vector.c
index 836d11b92811ce73446a6081f02a38231fdb9429..861bc59c8f2564eac7b87193e7cd250571e1fbf4 100644 (file)
@@ -361,7 +361,11 @@ int __init arch_probe_nr_irqs(void)
        if (nr < nr_irqs)
                nr_irqs = nr;
 
-       return nr_legacy_irqs();
+       /*
+        * We don't know if PIC is present at this point so we need to do
+        * probe() to get the right number of legacy IRQs.
+        */
+       return legacy_pic->probe();
 }
 
 #ifdef CONFIG_X86_IO_APIC