diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-02-23 08:40:35 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-23 11:26:50 -0500 |
commit | 2d57e37dbf648fd6547752b8954f4104a85f4b15 (patch) | |
tree | dee778f62a0d0490fcb6affe3ebb977d6c83ff9f | |
parent | e0799c04b2080e0832538a911361f962c93fb744 (diff) |
x86: ioapic: Use setup function in __io_apic_setup_irqs()
Replace the duplicated code.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index a655bd8fb063..63140d86759f 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -1401,8 +1401,8 @@ static bool __init io_apic_pin_not_connected(int idx, int apic_id, int pin) | |||
1401 | static void __init __io_apic_setup_irqs(unsigned int apic_id) | 1401 | static void __init __io_apic_setup_irqs(unsigned int apic_id) |
1402 | { | 1402 | { |
1403 | int idx, node = cpu_to_node(0); | 1403 | int idx, node = cpu_to_node(0); |
1404 | struct io_apic_irq_attr attr; | ||
1404 | unsigned int pin, irq; | 1405 | unsigned int pin, irq; |
1405 | struct irq_cfg *cfg; | ||
1406 | 1406 | ||
1407 | for (pin = 0; pin < nr_ioapic_registers[apic_id]; pin++) { | 1407 | for (pin = 0; pin < nr_ioapic_registers[apic_id]; pin++) { |
1408 | idx = find_irq_entry(apic_id, pin, mp_INT); | 1408 | idx = find_irq_entry(apic_id, pin, mp_INT); |
@@ -1419,20 +1419,13 @@ static void __init __io_apic_setup_irqs(unsigned int apic_id) | |||
1419 | * installed and if it returns 1: | 1419 | * installed and if it returns 1: |
1420 | */ | 1420 | */ |
1421 | if (apic->multi_timer_check && | 1421 | if (apic->multi_timer_check && |
1422 | apic->multi_timer_check(apic_id, irq)) | 1422 | apic->multi_timer_check(apic_id, irq)) |
1423 | continue; | 1423 | continue; |
1424 | 1424 | ||
1425 | cfg = alloc_irq_and_cfg_at(irq, node); | 1425 | set_io_apic_irq_attr(&attr, apic_id, pin, irq_trigger(idx), |
1426 | if (!cfg) | 1426 | irq_polarity(idx)); |
1427 | continue; | ||
1428 | 1427 | ||
1429 | add_pin_to_irq_node(cfg, node, apic_id, pin); | 1428 | io_apic_setup_irq_pin(irq, node, &attr); |
1430 | /* | ||
1431 | * don't mark it in pin_programmed, so later acpi could | ||
1432 | * set it correctly when irq < 16 | ||
1433 | */ | ||
1434 | setup_ioapic_irq(apic_id, pin, irq, cfg, irq_trigger(idx), | ||
1435 | irq_polarity(idx)); | ||
1436 | } | 1429 | } |
1437 | } | 1430 | } |
1438 | 1431 | ||