From a0368029133f005251e218d98d4ca053afaafe6f Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 5 Nov 2012 16:32:29 -0600 Subject: ARM: remove mach .handle_irq for VIC users Now that the VIC initialization sets up the handle_arch_irq pointer, we can remove it for all machines and make it static. Move vic_handle_irq to avoid a forward declaration. Signed-off-by: Rob Herring Cc: Ryan Mallon Cc: Russell King Cc: Hubert Feurstein Cc: Alessandro Rubini Cc: STEricsson Cc: Ben Dooks Cc: Kyungmin Park Cc: Shiraz Hashim Cc: Rajeev Kumar Acked-by: H Hartley Sweeten Acked-by: Jamie Iles Acked-by: Linus Walleij Acked-by: Mark Brown Acked-by: Viresh Kumar Acked-by: Kukjin Kim Acked-by: Olof Johansson Acked-by: Arnd Bergmann --- arch/arm/common/vic.c | 70 ++++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 34 deletions(-) (limited to 'arch/arm/common') diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c index 5feb004aaea6..49af6187885f 100644 --- a/arch/arm/common/vic.c +++ b/arch/arm/common/vic.c @@ -83,6 +83,8 @@ static struct vic_device vic_devices[CONFIG_ARM_VIC_NR]; static int vic_id; +static void vic_handle_irq(struct pt_regs *regs); + /** * vic_init2 - common initialisation code * @base: Base of the VIC. @@ -199,6 +201,40 @@ static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq, return 0; } +/* + * Handle each interrupt in a single VIC. Returns non-zero if we've + * handled at least one interrupt. This reads the status register + * before handling each interrupt, which is necessary given that + * handle_IRQ may briefly re-enable interrupts for soft IRQ handling. + */ +static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs) +{ + u32 stat, irq; + int handled = 0; + + while ((stat = readl_relaxed(vic->base + VIC_IRQ_STATUS))) { + irq = ffs(stat) - 1; + handle_IRQ(irq_find_mapping(vic->domain, irq), regs); + handled = 1; + } + + return handled; +} + +/* + * Keep iterating over all registered VIC's until there are no pending + * interrupts. + */ +static asmlinkage void __exception_irq_entry vic_handle_irq(struct pt_regs *regs) +{ + int i, handled; + + do { + for (i = 0, handled = 0; i < vic_id; ++i) + handled |= handle_one_vic(&vic_devices[i], regs); + } while (handled); +} + static struct irq_domain_ops vic_irqdomain_ops = { .map = vic_irqdomain_map, .xlate = irq_domain_xlate_onetwocell, @@ -446,37 +482,3 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent) return 0; } #endif /* CONFIG OF */ - -/* - * Handle each interrupt in a single VIC. Returns non-zero if we've - * handled at least one interrupt. This reads the status register - * before handling each interrupt, which is necessary given that - * handle_IRQ may briefly re-enable interrupts for soft IRQ handling. - */ -static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs) -{ - u32 stat, irq; - int handled = 0; - - while ((stat = readl_relaxed(vic->base + VIC_IRQ_STATUS))) { - irq = ffs(stat) - 1; - handle_IRQ(irq_find_mapping(vic->domain, irq), regs); - handled = 1; - } - - return handled; -} - -/* - * Keep iterating over all registered VIC's until there are no pending - * interrupts. - */ -asmlinkage void __exception_irq_entry vic_handle_irq(struct pt_regs *regs) -{ - int i, handled; - - do { - for (i = 0, handled = 0; i < vic_id; ++i) - handled |= handle_one_vic(&vic_devices[i], regs); - } while (handled); -} -- cgit v1.2.3