Skip to content

Commit 4e69f13

Browse files
bvanasscheKAGA-KOKO
authored andcommitted
net: hamradio: scc: 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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent bc6e6f0 commit 4e69f13

File tree

1 file changed

+3
-1
lines changed
  • drivers/net/hamradio

1 file changed

+3
-1
lines changed

drivers/net/hamradio/scc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,7 @@ scc_start_calibrate(struct scc_channel *scc, int duration, unsigned char pattern
14601460

14611461
static void z8530_init(void)
14621462
{
1463+
const unsigned int nr_irqs = irq_get_nr_irqs();
14631464
struct scc_channel *scc;
14641465
int chip, k;
14651466
unsigned long flags;
@@ -1735,7 +1736,7 @@ static int scc_net_siocdevprivate(struct net_device *dev,
17351736

17361737
if (hwcfg.irq == 2) hwcfg.irq = 9;
17371738

1738-
if (hwcfg.irq < 0 || hwcfg.irq >= nr_irqs)
1739+
if (hwcfg.irq < 0 || hwcfg.irq >= irq_get_nr_irqs())
17391740
return -EINVAL;
17401741

17411742
if (!Ivec[hwcfg.irq].used && hwcfg.irq)
@@ -2117,6 +2118,7 @@ static int __init scc_init_driver (void)
21172118

21182119
static void __exit scc_cleanup_driver(void)
21192120
{
2121+
const unsigned int nr_irqs = irq_get_nr_irqs();
21202122
io_port ctrl;
21212123
int k;
21222124
struct scc_channel *scc;

0 commit comments

Comments
 (0)