]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ARM: Switch to irq_get_nr_irqs() / irq_set_nr_irqs()
authorBart Van Assche <bvanassche@acm.org>
Tue, 15 Oct 2024 19:09:33 +0000 (12:09 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 16 Oct 2024 19:56:56 +0000 (21:56 +0200)
Use the irq_get_nr_irqs() and irq_set_nr_irqs() functions instead of the
global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an
exported global variable into a variable with file scope.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20241015190953.1266194-3-bvanassche@acm.org
arch/arm/kernel/irq.c

index dab42d066d068b4f2151f98955005bd82012ac00..e1993e28a9ecfd80b55b2677253ac582467e6c14 100644 (file)
@@ -111,7 +111,7 @@ void handle_IRQ(unsigned int irq, struct pt_regs *regs)
         * Some hardware gives randomly wrong interrupts.  Rather
         * than crashing, do something sensible.
         */
-       if (unlikely(!irq || irq >= nr_irqs))
+       if (unlikely(!irq || irq >= irq_get_nr_irqs()))
                desc = NULL;
        else
                desc = irq_to_desc(irq);
@@ -151,7 +151,6 @@ void __init init_IRQ(void)
 #ifdef CONFIG_SPARSE_IRQ
 int __init arch_probe_nr_irqs(void)
 {
-       nr_irqs = machine_desc->nr_irqs ? machine_desc->nr_irqs : NR_IRQS;
-       return nr_irqs;
+       return irq_set_nr_irqs(machine_desc->nr_irqs ? : NR_IRQS);
 }
 #endif