Commit 9b6c04bc authored by Shinya Kuribayashi's avatar Shinya Kuribayashi Committed by Ralf Baechle

MIPS: EMMA2RH: Remove emma2rh_irq_base global variable

Let's use immediate value, instead.  This also saves memory footprint,
and probably a little bit faster.
Signed-off-by: default avatarShinya Kuribayashi <shinya.kuribayashi@necel.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 27bd8045
...@@ -41,19 +41,17 @@ ...@@ -41,19 +41,17 @@
/* number of total irqs supported by EMMA2RH */ /* number of total irqs supported by EMMA2RH */
#define NUM_EMMA2RH_IRQ 96 #define NUM_EMMA2RH_IRQ 96
static int emma2rh_irq_base = -1;
void ll_emma2rh_irq_enable(int); void ll_emma2rh_irq_enable(int);
void ll_emma2rh_irq_disable(int); void ll_emma2rh_irq_disable(int);
static void emma2rh_irq_enable(unsigned int irq) static void emma2rh_irq_enable(unsigned int irq)
{ {
ll_emma2rh_irq_enable(irq - emma2rh_irq_base); ll_emma2rh_irq_enable(irq - EMMA2RH_IRQ_BASE);
} }
static void emma2rh_irq_disable(unsigned int irq) static void emma2rh_irq_disable(unsigned int irq)
{ {
ll_emma2rh_irq_disable(irq - emma2rh_irq_base); ll_emma2rh_irq_disable(irq - EMMA2RH_IRQ_BASE);
} }
struct irq_chip emma2rh_irq_controller = { struct irq_chip emma2rh_irq_controller = {
...@@ -64,15 +62,14 @@ struct irq_chip emma2rh_irq_controller = { ...@@ -64,15 +62,14 @@ struct irq_chip emma2rh_irq_controller = {
.unmask = emma2rh_irq_enable, .unmask = emma2rh_irq_enable,
}; };
void emma2rh_irq_init(u32 irq_base) void emma2rh_irq_init(void)
{ {
u32 i; u32 i;
for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ; i++) for (i = 0; i < NUM_EMMA2RH_IRQ; i++)
set_irq_chip_and_handler(i, &emma2rh_irq_controller, set_irq_chip_and_handler(EMMA2RH_IRQ_BASE + i,
&emma2rh_irq_controller,
handle_level_irq); handle_level_irq);
emma2rh_irq_base = irq_base;
} }
void ll_emma2rh_irq_enable(int emma2rh_irq) void ll_emma2rh_irq_enable(int emma2rh_irq)
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
extern void emma2rh_sw_irq_init(u32 base); extern void emma2rh_sw_irq_init(u32 base);
extern void emma2rh_gpio_irq_init(u32 base); extern void emma2rh_gpio_irq_init(u32 base);
extern void emma2rh_irq_init(u32 base); extern void emma2rh_irq_init(void);
extern void emma2rh_irq_dispatch(void); extern void emma2rh_irq_dispatch(void);
static struct irqaction irq_cascade = { static struct irqaction irq_cascade = {
...@@ -102,7 +102,7 @@ void __init arch_init_irq(void) ...@@ -102,7 +102,7 @@ void __init arch_init_irq(void)
emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~GPIO_PCI); emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~GPIO_PCI);
/* init all controllers */ /* init all controllers */
emma2rh_irq_init(EMMA2RH_IRQ_BASE); emma2rh_irq_init();
emma2rh_sw_irq_init(EMMA2RH_SW_IRQ_BASE); emma2rh_sw_irq_init(EMMA2RH_SW_IRQ_BASE);
emma2rh_gpio_irq_init(EMMA2RH_GPIO_IRQ_BASE); emma2rh_gpio_irq_init(EMMA2RH_GPIO_IRQ_BASE);
mips_cpu_irq_init(); mips_cpu_irq_init();
......
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