Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: cpm_uart: Switch to irq_get_nr_irqs()

Use the irq_get_nr_irqs() function 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-17-bvanassche@acm.org

authored by

Bart Van Assche and committed by
Thomas Gleixner
b9b5df29 d1a9a2f4

+1 -1
+1 -1
drivers/tty/serial/cpm_uart.c
··· 631 631 632 632 if (ser->type != PORT_UNKNOWN && ser->type != PORT_CPM) 633 633 ret = -EINVAL; 634 - if (ser->irq < 0 || ser->irq >= nr_irqs) 634 + if (ser->irq < 0 || ser->irq >= irq_get_nr_irqs()) 635 635 ret = -EINVAL; 636 636 if (ser->baud_base < 9600) 637 637 ret = -EINVAL;