Commit 664399e1 authored by Russell King's avatar Russell King Committed by Russell King

[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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 7801907b
...@@ -177,7 +177,7 @@ static void locomo_handler(unsigned int irq, struct irqdesc *desc, ...@@ -177,7 +177,7 @@ static void locomo_handler(unsigned int irq, struct irqdesc *desc,
d = irq_desc + irq; d = irq_desc + irq;
for (i = 0; i <= 3; i++, d++, irq++) { for (i = 0; i <= 3; i++, d++, irq++) {
if (req & (0x0100 << i)) { 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, ...@@ -220,7 +220,7 @@ static void locomo_key_handler(unsigned int irq, struct irqdesc *desc,
if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) { if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) {
d = irq_desc + LOCOMO_IRQ_KEY_START; 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, ...@@ -273,7 +273,7 @@ static void locomo_gpio_handler(unsigned int irq, struct irqdesc *desc,
d = irq_desc + LOCOMO_IRQ_GPIO_START; d = irq_desc + LOCOMO_IRQ_GPIO_START;
for (i = 0; i <= 15; i++, irq++, d++) { for (i = 0; i <= 15; i++, irq++, d++) {
if (req & (0x0001 << i)) { 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, ...@@ -328,7 +328,7 @@ static void locomo_lt_handler(unsigned int irq, struct irqdesc *desc,
if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) { if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) {
d = irq_desc + LOCOMO_IRQ_LT_START; 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, ...@@ -379,7 +379,7 @@ static void locomo_spi_handler(unsigned int irq, struct irqdesc *desc,
for (i = 0; i <= 3; i++, irq++, d++) { for (i = 0; i <= 3; i++, irq++, d++) {
if (req & (0x0001 << i)) { 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) ...@@ -585,7 +585,7 @@ ecard_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
if (pending) { if (pending) {
struct irqdesc *d = irq_desc + ec->irq; struct irqdesc *d = irq_desc + ec->irq;
d->handle(ec->irq, d, regs); desc_handle_irq(ec->irq, d, regs);
called ++; called ++;
} }
} }
...@@ -632,7 +632,7 @@ ecard_irqexp_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg ...@@ -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 * Serial cards should go in 0/1, ethernet/scsi in 2/3
* otherwise you will lose serial data at high speeds! * otherwise you will lose serial data at high speeds!
*/ */
d->handle(ec->irq, d, regs); desc_handle_irq(ec->irq, d, regs);
} else { } else {
printk(KERN_WARNING "card%d: interrupt from unclaimed " printk(KERN_WARNING "card%d: interrupt from unclaimed "
"card???\n", slot); "card???\n", slot);
......
...@@ -517,7 +517,7 @@ static void do_pending_irqs(struct pt_regs *regs) ...@@ -517,7 +517,7 @@ static void do_pending_irqs(struct pt_regs *regs)
list_for_each_safe(l, n, &head) { list_for_each_safe(l, n, &head) {
desc = list_entry(l, struct irqdesc, pend); desc = list_entry(l, struct irqdesc, pend);
list_del_init(&desc->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) ...@@ -545,7 +545,7 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
irq_enter(); irq_enter();
spin_lock(&irq_controller_lock); spin_lock(&irq_controller_lock);
desc->handle(irq, desc, regs); desc_handle_irq(irq, desc, regs);
/* /*
* Now re-run any pending interrupts. * Now re-run any pending interrupts.
......
...@@ -95,7 +95,7 @@ isa_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -95,7 +95,7 @@ isa_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
} }
desc = irq_desc + isa_irq; 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", }; static struct irqaction irq_cascade = { .handler = no_action, .name = "cascade", };
......
...@@ -108,7 +108,7 @@ h720x_gpio_handler(unsigned int mask, unsigned int irq, ...@@ -108,7 +108,7 @@ h720x_gpio_handler(unsigned int mask, unsigned int irq,
while (mask) { while (mask) {
if (mask & 1) { if (mask & 1) {
IRQDBG("handling irq %d\n", irq); IRQDBG("handling irq %d\n", irq);
desc->handle(irq, desc, regs); desc_handle_irq(irq, desc, regs);
} }
irq++; irq++;
desc++; desc++;
......
...@@ -126,7 +126,7 @@ h7202_timerx_demux_handler(unsigned int irq_unused, struct irqdesc *desc, ...@@ -126,7 +126,7 @@ h7202_timerx_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
desc = irq_desc + irq; desc = irq_desc + irq;
while (mask) { while (mask) {
if (mask & 1) if (mask & 1)
desc->handle(irq, desc, regs); desc_handle_irq(irq, desc, regs);
irq++; irq++;
desc++; desc++;
mask >>= 1; mask >>= 1;
......
...@@ -152,7 +152,7 @@ imx_gpio_handler(unsigned int mask, unsigned int irq, ...@@ -152,7 +152,7 @@ imx_gpio_handler(unsigned int mask, unsigned int irq,
while (mask) { while (mask) {
if (mask & 1) { if (mask & 1) {
DEBUG_IRQ("handling irq %d\n", irq); DEBUG_IRQ("handling irq %d\n", irq);
desc->handle(irq, desc, regs); desc_handle_irq(irq, desc, regs);
} }
irq++; irq++;
desc++; desc++;
......
...@@ -170,7 +170,7 @@ sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -170,7 +170,7 @@ sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
irq += IRQ_SIC_START; irq += IRQ_SIC_START;
desc = irq_desc + irq; desc = irq_desc + irq;
desc->handle(irq, desc, regs); desc_handle_irq(irq, desc, regs);
} while (status); } while (status);
} }
......
...@@ -317,7 +317,7 @@ static void ixp2000_GPIO_irq_handler(unsigned int irq, struct irqdesc *desc, str ...@@ -317,7 +317,7 @@ static void ixp2000_GPIO_irq_handler(unsigned int irq, struct irqdesc *desc, str
for (i = 0; i <= 7; i++) { for (i = 0; i <= 7; i++) {
if (status & (1<<i)) { if (status & (1<<i)) {
desc = irq_desc + i + IRQ_IXP2000_GPIO0; 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 ...@@ -133,7 +133,7 @@ static void ixdp2x00_irq_handler(unsigned int irq, struct irqdesc *desc, struct
struct irqdesc *cpld_desc; struct irqdesc *cpld_desc;
int cpld_irq = IXP2000_BOARD_IRQ(0) + i; int cpld_irq = IXP2000_BOARD_IRQ(0) + i;
cpld_desc = irq_desc + cpld_irq; 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 ...@@ -82,7 +82,7 @@ static void ixdp2x01_irq_handler(unsigned int irq, struct irqdesc *desc, struct
struct irqdesc *cpld_desc; struct irqdesc *cpld_desc;
int cpld_irq = IXP2000_BOARD_IRQ(0) + i; int cpld_irq = IXP2000_BOARD_IRQ(0) + i;
cpld_desc = irq_desc + cpld_irq; 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; ...@@ -13,4 +13,4 @@ extern struct sys_timer lh7a40x_timer;
extern void lh7a400_init_irq (void); extern void lh7a400_init_irq (void);
extern void lh7a404_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, ...@@ -102,7 +102,7 @@ void innovator_fpga_IRQ_demux(unsigned int irq, struct irqdesc *desc,
fpga_irq++, stat >>= 1) { fpga_irq++, stat >>= 1) {
if (stat & 1) { if (stat & 1) {
d = irq_desc + fpga_irq; 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, ...@@ -157,7 +157,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc,
mask >>= 2; mask >>= 2;
do { do {
if (mask & 1) if (mask & 1)
desc->handle(irq, desc, regs); desc_handle_irq(irq, desc, regs);
irq++; irq++;
desc++; desc++;
mask >>= 1; mask >>= 1;
...@@ -172,7 +172,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc, ...@@ -172,7 +172,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc,
desc = irq_desc + irq; desc = irq_desc + irq;
do { do {
if (mask & 1) if (mask & 1)
desc->handle(irq, desc, regs); desc_handle_irq(irq, desc, regs);
irq++; irq++;
desc++; desc++;
mask >>= 1; mask >>= 1;
...@@ -187,7 +187,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc, ...@@ -187,7 +187,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc,
desc = irq_desc + irq; desc = irq_desc + irq;
do { do {
if (mask & 1) if (mask & 1)
desc->handle(irq, desc, regs); desc_handle_irq(irq, desc, regs);
irq++; irq++;
desc++; desc++;
mask >>= 1; mask >>= 1;
...@@ -203,7 +203,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc, ...@@ -203,7 +203,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc,
desc = irq_desc + irq; desc = irq_desc + irq;
do { do {
if (mask & 1) if (mask & 1)
desc->handle(irq, desc, regs); desc_handle_irq(irq, desc, regs);
irq++; irq++;
desc++; desc++;
mask >>= 1; mask >>= 1;
......
...@@ -84,7 +84,7 @@ static void lubbock_irq_handler(unsigned int irq, struct irqdesc *desc, ...@@ -84,7 +84,7 @@ static void lubbock_irq_handler(unsigned int irq, struct irqdesc *desc,
if (likely(pending)) { if (likely(pending)) {
irq = LUBBOCK_IRQ(0) + __ffs(pending); irq = LUBBOCK_IRQ(0) + __ffs(pending);
desc = irq_desc + irq; desc = irq_desc + irq;
desc->handle(irq, desc, regs); desc_handle_irq(irq, desc, regs);
} }
pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled; pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled;
} while (pending); } while (pending);
......
...@@ -72,7 +72,7 @@ static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc, ...@@ -72,7 +72,7 @@ static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc,
if (likely(pending)) { if (likely(pending)) {
irq = MAINSTONE_IRQ(0) + __ffs(pending); irq = MAINSTONE_IRQ(0) + __ffs(pending);
desc = irq_desc + irq; desc = irq_desc + irq;
desc->handle(irq, desc, regs); desc_handle_irq(irq, desc, regs);
} }
pending = MST_INTSETCLR & mainstone_irq_enabled; pending = MST_INTSETCLR & mainstone_irq_enabled;
} while (pending); } while (pending);
......
...@@ -124,7 +124,7 @@ bast_irq_pc104_demux(unsigned int irq, ...@@ -124,7 +124,7 @@ bast_irq_pc104_demux(unsigned int irq,
irqno = bast_pc104_irqs[i]; irqno = bast_pc104_irqs[i];
desc = irq_desc + irqno; desc = irq_desc + irqno;
desc->handle(irqno, desc, regs); desc_handle_irq(irqno, desc, regs);
} }
stat >>= 1; stat >>= 1;
......
...@@ -496,11 +496,11 @@ static void s3c_irq_demux_adc(unsigned int irq, ...@@ -496,11 +496,11 @@ static void s3c_irq_demux_adc(unsigned int irq,
if (subsrc != 0) { if (subsrc != 0) {
if (subsrc & 1) { if (subsrc & 1) {
mydesc = irq_desc + IRQ_TC; mydesc = irq_desc + IRQ_TC;
mydesc->handle( IRQ_TC, mydesc, regs); desc_handle_irq(IRQ_TC, mydesc, regs);
} }
if (subsrc & 2) { if (subsrc & 2) {
mydesc = irq_desc + IRQ_ADC; 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, ...@@ -529,17 +529,17 @@ static void s3c_irq_demux_uart(unsigned int start,
desc = irq_desc + start; desc = irq_desc + start;
if (subsrc & 1) if (subsrc & 1)
desc->handle(start, desc, regs); desc_handle_irq(start, desc, regs);
desc++; desc++;
if (subsrc & 2) if (subsrc & 2)
desc->handle(start+1, desc, regs); desc_handle_irq(start+1, desc, regs);
desc++; desc++;
if (subsrc & 4) 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, ...@@ -64,11 +64,11 @@ static void s3c_irq_demux_wdtac97(unsigned int irq,
if (subsrc != 0) { if (subsrc != 0) {
if (subsrc & 1) { if (subsrc & 1) {
mydesc = irq_desc + IRQ_S3C2440_WDT; mydesc = irq_desc + IRQ_S3C2440_WDT;
mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs); desc_handle_irq(IRQ_S3C2440_WDT, mydesc, regs);
} }
if (subsrc & 2) { if (subsrc & 2) {
mydesc = irq_desc + IRQ_S3C2440_AC97; 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, ...@@ -122,11 +122,11 @@ static void s3c_irq_demux_cam(unsigned int irq,
if (subsrc != 0) { if (subsrc != 0) {
if (subsrc & 1) { if (subsrc & 1) {
mydesc = irq_desc + IRQ_S3C2440_CAM_C; 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) { if (subsrc & 2) {
mydesc = irq_desc + IRQ_S3C2440_CAM_P; 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, ...@@ -126,7 +126,7 @@ sa1100_high_gpio_handler(unsigned int irq, struct irqdesc *desc,
mask >>= 11; mask >>= 11;
do { do {
if (mask & 1) if (mask & 1)
desc->handle(irq, desc, regs); desc_handle_irq(irq, desc, regs);
mask >>= 1; mask >>= 1;
irq++; irq++;
desc++; desc++;
......
...@@ -61,12 +61,12 @@ neponset_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg ...@@ -61,12 +61,12 @@ neponset_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg
if (irr & IRR_ETHERNET) { if (irr & IRR_ETHERNET) {
d = irq_desc + IRQ_NEPONSET_SMC9196; 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) { if (irr & IRR_USAR) {
d = irq_desc + IRQ_NEPONSET_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); desc->chip->unmask(irq);
...@@ -74,7 +74,7 @@ neponset_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg ...@@ -74,7 +74,7 @@ neponset_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg
if (irr & IRR_SA1111) { if (irr & IRR_SA1111) {
d = irq_desc + IRQ_NEPONSET_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) ...@@ -108,7 +108,7 @@ sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
irq += IRQ_SIC_START; irq += IRQ_SIC_START;
desc = irq_desc + irq; desc = irq_desc + irq;
desc->handle(irq, desc, regs); desc_handle_irq(irq, desc, regs);
} while (status); } while (status);
} }
......
...@@ -590,7 +590,7 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc, ...@@ -590,7 +590,7 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
if (!(isr & 1)) if (!(isr & 1))
continue; continue;
d = irq_desc + gpio_irq; d = irq_desc + gpio_irq;
d->handle(gpio_irq, d, regs); desc_handle_irq(gpio_irq, d, regs);
} }
} }
......
...@@ -91,6 +91,14 @@ struct irqdesc { ...@@ -91,6 +91,14 @@ struct irqdesc {
extern struct irqdesc irq_desc[]; 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. * This is internal. Do not use it.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment