Skip to content

Commit 40a72c8

Browse files
committed
m68k/irq: Extract irq_set_chip()
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 13d6da3 commit 40a72c8

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎arch/m68k/kernel/ints.c‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ static struct irq_data *irq_list[NR_IRQS];
5555
static struct irq_chip *irq_chip[NR_IRQS];
5656
static int irq_depth[NR_IRQS];
5757

58+
static inline int irq_set_chip(unsigned int irq, struct irq_chip *chip)
59+
{
60+
irq_chip[irq] = chip;
61+
return 0;
62+
}
63+
5864
static int m68k_first_user_vec;
5965

6066
static struct irq_chip auto_irq_chip = {
@@ -94,7 +100,7 @@ void __init init_IRQ(void)
94100
}
95101

96102
for (i = IRQ_AUTO_1; i <= IRQ_AUTO_7; i++)
97-
irq_chip[i] = &auto_irq_chip;
103+
irq_set_chip(i, &auto_irq_chip);
98104

99105
mach_init_IRQ();
100106
}
@@ -134,7 +140,7 @@ void __init m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt,
134140
BUG_ON(IRQ_USER + cnt > NR_IRQS);
135141
m68k_first_user_vec = vec;
136142
for (i = 0; i < cnt; i++)
137-
irq_chip[IRQ_USER + i] = &user_irq_chip;
143+
irq_set_chip(IRQ_USER + i, &user_irq_chip);
138144
*user_irqvec_fixup = vec - IRQ_USER;
139145
if (handler)
140146
*user_irqhandler_fixup = (u32)handler;
@@ -157,7 +163,7 @@ void m68k_setup_irq_chip(struct irq_chip *contr, unsigned int irq,
157163
int i;
158164

159165
for (i = 0; i < cnt; i++)
160-
irq_chip[irq + i] = contr;
166+
irq_set_chip(irq + i, contr);
161167
}
162168

163169
struct irq_data *new_irq_node(void)

0 commit comments

Comments
 (0)