[ARM] Wrap calls to descriptor handlers
This is part of Thomas Gleixner's generic IRQ patch, which converts ARM to use the generic IRQ subsystem. Here, we wrap calls to desc->handler() in an inline function, desc_handle_irq(). This reduces the size of Thomas' patch since the changes become more localised. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
7801907b8c
commit
664399e1fb
|
@ -177,7 +177,7 @@ static void locomo_handler(unsigned int irq, struct irqdesc *desc,
|
|||
d = irq_desc + irq;
|
||||
for (i = 0; i <= 3; i++, d++, irq++) {
|
||||
if (req & (0x0100 << i)) {
|
||||
d->handle(irq, d, regs);
|
||||
desc_handle_irq(irq, d, regs);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ static void locomo_key_handler(unsigned int irq, struct irqdesc *desc,
|
|||
|
||||
if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) {
|
||||
d = irq_desc + LOCOMO_IRQ_KEY_START;
|
||||
d->handle(LOCOMO_IRQ_KEY_START, d, regs);
|
||||
desc_handle_irq(LOCOMO_IRQ_KEY_START, d, regs);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -273,7 +273,7 @@ static void locomo_gpio_handler(unsigned int irq, struct irqdesc *desc,
|
|||
d = irq_desc + LOCOMO_IRQ_GPIO_START;
|
||||
for (i = 0; i <= 15; i++, irq++, d++) {
|
||||
if (req & (0x0001 << i)) {
|
||||
d->handle(irq, d, regs);
|
||||
desc_handle_irq(irq, d, regs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -328,7 +328,7 @@ static void locomo_lt_handler(unsigned int irq, struct irqdesc *desc,
|
|||
|
||||
if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) {
|
||||
d = irq_desc + LOCOMO_IRQ_LT_START;
|
||||
d->handle(LOCOMO_IRQ_LT_START, d, regs);
|
||||
desc_handle_irq(LOCOMO_IRQ_LT_START, d, regs);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -379,7 +379,7 @@ static void locomo_spi_handler(unsigned int irq, struct irqdesc *desc,
|
|||
|
||||
for (i = 0; i <= 3; i++, irq++, d++) {
|
||||
if (req & (0x0001 << i)) {
|
||||
d->handle(irq, d, regs);
|
||||
desc_handle_irq(irq, d, regs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -585,7 +585,7 @@ ecard_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
|
|||
|
||||
if (pending) {
|
||||
struct irqdesc *d = irq_desc + ec->irq;
|
||||
d->handle(ec->irq, d, regs);
|
||||
desc_handle_irq(ec->irq, d, regs);
|
||||
called ++;
|
||||
}
|
||||
}
|
||||
|
@ -632,7 +632,7 @@ ecard_irqexp_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg
|
|||
* Serial cards should go in 0/1, ethernet/scsi in 2/3
|
||||
* otherwise you will lose serial data at high speeds!
|
||||
*/
|
||||
d->handle(ec->irq, d, regs);
|
||||
desc_handle_irq(ec->irq, d, regs);
|
||||
} else {
|
||||
printk(KERN_WARNING "card%d: interrupt from unclaimed "
|
||||
"card???\n", slot);
|
||||
|
|
|
@ -517,7 +517,7 @@ static void do_pending_irqs(struct pt_regs *regs)
|
|||
list_for_each_safe(l, n, &head) {
|
||||
desc = list_entry(l, struct irqdesc, pend);
|
||||
list_del_init(&desc->pend);
|
||||
desc->handle(desc - irq_desc, desc, regs);
|
||||
desc_handle_irq(desc - irq_desc, desc, regs);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -545,7 +545,7 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
|
|||
|
||||
irq_enter();
|
||||
spin_lock(&irq_controller_lock);
|
||||
desc->handle(irq, desc, regs);
|
||||
desc_handle_irq(irq, desc, regs);
|
||||
|
||||
/*
|
||||
* Now re-run any pending interrupts.
|
||||
|
|
|
@ -95,7 +95,7 @@ isa_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
|
|||
}
|
||||
|
||||
desc = irq_desc + isa_irq;
|
||||
desc->handle(isa_irq, desc, regs);
|
||||
desc_handle_irq(isa_irq, desc, regs);
|
||||
}
|
||||
|
||||
static struct irqaction irq_cascade = { .handler = no_action, .name = "cascade", };
|
||||
|
|
|
@ -108,7 +108,7 @@ h720x_gpio_handler(unsigned int mask, unsigned int irq,
|
|||
while (mask) {
|
||||
if (mask & 1) {
|
||||
IRQDBG("handling irq %d\n", irq);
|
||||
desc->handle(irq, desc, regs);
|
||||
desc_handle_irq(irq, desc, regs);
|
||||
}
|
||||
irq++;
|
||||
desc++;
|
||||
|
|
|
@ -126,7 +126,7 @@ h7202_timerx_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
|
|||
desc = irq_desc + irq;
|
||||
while (mask) {
|
||||
if (mask & 1)
|
||||
desc->handle(irq, desc, regs);
|
||||
desc_handle_irq(irq, desc, regs);
|
||||
irq++;
|
||||
desc++;
|
||||
mask >>= 1;
|
||||
|
|
|
@ -152,7 +152,7 @@ imx_gpio_handler(unsigned int mask, unsigned int irq,
|
|||
while (mask) {
|
||||
if (mask & 1) {
|
||||
DEBUG_IRQ("handling irq %d\n", irq);
|
||||
desc->handle(irq, desc, regs);
|
||||
desc_handle_irq(irq, desc, regs);
|
||||
}
|
||||
irq++;
|
||||
desc++;
|
||||
|
|
|
@ -170,7 +170,7 @@ sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
|
|||
irq += IRQ_SIC_START;
|
||||
|
||||
desc = irq_desc + irq;
|
||||
desc->handle(irq, desc, regs);
|
||||
desc_handle_irq(irq, desc, regs);
|
||||
} while (status);
|
||||
}
|
||||
|
||||
|
|
|
@ -317,7 +317,7 @@ static void ixp2000_GPIO_irq_handler(unsigned int irq, struct irqdesc *desc, str
|
|||
for (i = 0; i <= 7; i++) {
|
||||
if (status & (1<<i)) {
|
||||
desc = irq_desc + i + IRQ_IXP2000_GPIO0;
|
||||
desc->handle(i + IRQ_IXP2000_GPIO0, desc, regs);
|
||||
desc_handle_irq(i + IRQ_IXP2000_GPIO0, desc, regs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ static void ixdp2x00_irq_handler(unsigned int irq, struct irqdesc *desc, struct
|
|||
struct irqdesc *cpld_desc;
|
||||
int cpld_irq = IXP2000_BOARD_IRQ(0) + i;
|
||||
cpld_desc = irq_desc + cpld_irq;
|
||||
cpld_desc->handle(cpld_irq, cpld_desc, regs);
|
||||
desc_handle_irq(cpld_irq, cpld_desc, regs);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ static void ixdp2x01_irq_handler(unsigned int irq, struct irqdesc *desc, struct
|
|||
struct irqdesc *cpld_desc;
|
||||
int cpld_irq = IXP2000_BOARD_IRQ(0) + i;
|
||||
cpld_desc = irq_desc + cpld_irq;
|
||||
cpld_desc->handle(cpld_irq, cpld_desc, regs);
|
||||
desc_handle_irq(cpld_irq, cpld_desc, regs);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,4 +13,4 @@ extern struct sys_timer lh7a40x_timer;
|
|||
extern void lh7a400_init_irq (void);
|
||||
extern void lh7a404_init_irq (void);
|
||||
|
||||
#define IRQ_DISPATCH(irq) irq_desc[irq].handle ((irq), &irq_desc[irq], regs)
|
||||
#define IRQ_DISPATCH(irq) desc_handle_irq((irq),(irq_desc + irq), regs)
|
||||
|
|
|
@ -102,7 +102,7 @@ void innovator_fpga_IRQ_demux(unsigned int irq, struct irqdesc *desc,
|
|||
fpga_irq++, stat >>= 1) {
|
||||
if (stat & 1) {
|
||||
d = irq_desc + fpga_irq;
|
||||
d->handle(fpga_irq, d, regs);
|
||||
desc_handle_irq(fpga_irq, d, regs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc,
|
|||
mask >>= 2;
|
||||
do {
|
||||
if (mask & 1)
|
||||
desc->handle(irq, desc, regs);
|
||||
desc_handle_irq(irq, desc, regs);
|
||||
irq++;
|
||||
desc++;
|
||||
mask >>= 1;
|
||||
|
@ -172,7 +172,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc,
|
|||
desc = irq_desc + irq;
|
||||
do {
|
||||
if (mask & 1)
|
||||
desc->handle(irq, desc, regs);
|
||||
desc_handle_irq(irq, desc, regs);
|
||||
irq++;
|
||||
desc++;
|
||||
mask >>= 1;
|
||||
|
@ -187,7 +187,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc,
|
|||
desc = irq_desc + irq;
|
||||
do {
|
||||
if (mask & 1)
|
||||
desc->handle(irq, desc, regs);
|
||||
desc_handle_irq(irq, desc, regs);
|
||||
irq++;
|
||||
desc++;
|
||||
mask >>= 1;
|
||||
|
@ -203,7 +203,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc,
|
|||
desc = irq_desc + irq;
|
||||
do {
|
||||
if (mask & 1)
|
||||
desc->handle(irq, desc, regs);
|
||||
desc_handle_irq(irq, desc, regs);
|
||||
irq++;
|
||||
desc++;
|
||||
mask >>= 1;
|
||||
|
|
|
@ -84,7 +84,7 @@ static void lubbock_irq_handler(unsigned int irq, struct irqdesc *desc,
|
|||
if (likely(pending)) {
|
||||
irq = LUBBOCK_IRQ(0) + __ffs(pending);
|
||||
desc = irq_desc + irq;
|
||||
desc->handle(irq, desc, regs);
|
||||
desc_handle_irq(irq, desc, regs);
|
||||
}
|
||||
pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled;
|
||||
} while (pending);
|
||||
|
|
|
@ -72,7 +72,7 @@ static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc,
|
|||
if (likely(pending)) {
|
||||
irq = MAINSTONE_IRQ(0) + __ffs(pending);
|
||||
desc = irq_desc + irq;
|
||||
desc->handle(irq, desc, regs);
|
||||
desc_handle_irq(irq, desc, regs);
|
||||
}
|
||||
pending = MST_INTSETCLR & mainstone_irq_enabled;
|
||||
} while (pending);
|
||||
|
|
|
@ -124,7 +124,7 @@ bast_irq_pc104_demux(unsigned int irq,
|
|||
irqno = bast_pc104_irqs[i];
|
||||
desc = irq_desc + irqno;
|
||||
|
||||
desc->handle(irqno, desc, regs);
|
||||
desc_handle_irq(irqno, desc, regs);
|
||||
}
|
||||
|
||||
stat >>= 1;
|
||||
|
|
|
@ -496,11 +496,11 @@ static void s3c_irq_demux_adc(unsigned int irq,
|
|||
if (subsrc != 0) {
|
||||
if (subsrc & 1) {
|
||||
mydesc = irq_desc + IRQ_TC;
|
||||
mydesc->handle( IRQ_TC, mydesc, regs);
|
||||
desc_handle_irq(IRQ_TC, mydesc, regs);
|
||||
}
|
||||
if (subsrc & 2) {
|
||||
mydesc = irq_desc + IRQ_ADC;
|
||||
mydesc->handle(IRQ_ADC, mydesc, regs);
|
||||
desc_handle_irq(IRQ_ADC, mydesc, regs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -529,17 +529,17 @@ static void s3c_irq_demux_uart(unsigned int start,
|
|||
desc = irq_desc + start;
|
||||
|
||||
if (subsrc & 1)
|
||||
desc->handle(start, desc, regs);
|
||||
desc_handle_irq(start, desc, regs);
|
||||
|
||||
desc++;
|
||||
|
||||
if (subsrc & 2)
|
||||
desc->handle(start+1, desc, regs);
|
||||
desc_handle_irq(start+1, desc, regs);
|
||||
|
||||
desc++;
|
||||
|
||||
if (subsrc & 4)
|
||||
desc->handle(start+2, desc, regs);
|
||||
desc_handle_irq(start+2, desc, regs);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,11 +64,11 @@ static void s3c_irq_demux_wdtac97(unsigned int irq,
|
|||
if (subsrc != 0) {
|
||||
if (subsrc & 1) {
|
||||
mydesc = irq_desc + IRQ_S3C2440_WDT;
|
||||
mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs);
|
||||
desc_handle_irq(IRQ_S3C2440_WDT, mydesc, regs);
|
||||
}
|
||||
if (subsrc & 2) {
|
||||
mydesc = irq_desc + IRQ_S3C2440_AC97;
|
||||
mydesc->handle(IRQ_S3C2440_AC97, mydesc, regs);
|
||||
desc_handle_irq(IRQ_S3C2440_AC97, mydesc, regs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -122,11 +122,11 @@ static void s3c_irq_demux_cam(unsigned int irq,
|
|||
if (subsrc != 0) {
|
||||
if (subsrc & 1) {
|
||||
mydesc = irq_desc + IRQ_S3C2440_CAM_C;
|
||||
mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs);
|
||||
desc_handle_irq(IRQ_S3C2440_CAM_C, mydesc, regs);
|
||||
}
|
||||
if (subsrc & 2) {
|
||||
mydesc = irq_desc + IRQ_S3C2440_CAM_P;
|
||||
mydesc->handle(IRQ_S3C2440_AC97, mydesc, regs);
|
||||
desc_handle_irq(IRQ_S3C2440_CAM_P, mydesc, regs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ sa1100_high_gpio_handler(unsigned int irq, struct irqdesc *desc,
|
|||
mask >>= 11;
|
||||
do {
|
||||
if (mask & 1)
|
||||
desc->handle(irq, desc, regs);
|
||||
desc_handle_irq(irq, desc, regs);
|
||||
mask >>= 1;
|
||||
irq++;
|
||||
desc++;
|
||||
|
|
|
@ -61,12 +61,12 @@ neponset_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg
|
|||
|
||||
if (irr & IRR_ETHERNET) {
|
||||
d = irq_desc + IRQ_NEPONSET_SMC9196;
|
||||
d->handle(IRQ_NEPONSET_SMC9196, d, regs);
|
||||
desc_handle_irq(IRQ_NEPONSET_SMC9196, d, regs);
|
||||
}
|
||||
|
||||
if (irr & IRR_USAR) {
|
||||
d = irq_desc + IRQ_NEPONSET_USAR;
|
||||
d->handle(IRQ_NEPONSET_USAR, d, regs);
|
||||
desc_handle_irq(IRQ_NEPONSET_USAR, d, regs);
|
||||
}
|
||||
|
||||
desc->chip->unmask(irq);
|
||||
|
@ -74,7 +74,7 @@ neponset_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg
|
|||
|
||||
if (irr & IRR_SA1111) {
|
||||
d = irq_desc + IRQ_NEPONSET_SA1111;
|
||||
d->handle(IRQ_NEPONSET_SA1111, d, regs);
|
||||
desc_handle_irq(IRQ_NEPONSET_SA1111, d, regs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
|
|||
irq += IRQ_SIC_START;
|
||||
|
||||
desc = irq_desc + irq;
|
||||
desc->handle(irq, desc, regs);
|
||||
desc_handle_irq(irq, desc, regs);
|
||||
} while (status);
|
||||
}
|
||||
|
||||
|
|
|
@ -590,7 +590,7 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
|
|||
if (!(isr & 1))
|
||||
continue;
|
||||
d = irq_desc + gpio_irq;
|
||||
d->handle(gpio_irq, d, regs);
|
||||
desc_handle_irq(gpio_irq, d, regs);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -91,6 +91,14 @@ struct irqdesc {
|
|||
|
||||
extern struct irqdesc irq_desc[];
|
||||
|
||||
/*
|
||||
* Helpful inline function for calling irq descriptor handlers.
|
||||
*/
|
||||
static inline void desc_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
|
||||
{
|
||||
desc->handle(irq, desc, regs);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is internal. Do not use it.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue