@@ -342,13 +342,12 @@ acpi_parse_lapic_nmi(struct acpi_subtable_header * header, const unsigned long e
342
342
#ifdef CONFIG_X86_IO_APIC
343
343
#define MP_ISA_BUS 0
344
344
345
+ static int __init mp_register_ioapic_irq (u8 bus_irq , u8 polarity ,
346
+ u8 trigger , u32 gsi );
347
+
345
348
static void __init mp_override_legacy_irq (u8 bus_irq , u8 polarity , u8 trigger ,
346
349
u32 gsi )
347
350
{
348
- int ioapic ;
349
- int pin ;
350
- struct mpc_intsrc mp_irq ;
351
-
352
351
/*
353
352
* Check bus_irq boundary.
354
353
*/
@@ -357,14 +356,6 @@ static void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,
357
356
return ;
358
357
}
359
358
360
- /*
361
- * Convert 'gsi' to 'ioapic.pin'.
362
- */
363
- ioapic = mp_find_ioapic (gsi );
364
- if (ioapic < 0 )
365
- return ;
366
- pin = mp_find_ioapic_pin (ioapic , gsi );
367
-
368
359
/*
369
360
* TBD: This check is for faulty timer entries, where the override
370
361
* erroneously sets the trigger to level, resulting in a HUGE
@@ -373,16 +364,8 @@ static void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,
373
364
if ((bus_irq == 0 ) && (trigger == 3 ))
374
365
trigger = 1 ;
375
366
376
- mp_irq .type = MP_INTSRC ;
377
- mp_irq .irqtype = mp_INT ;
378
- mp_irq .irqflag = (trigger << 2 ) | polarity ;
379
- mp_irq .srcbus = MP_ISA_BUS ;
380
- mp_irq .srcbusirq = bus_irq ; /* IRQ */
381
- mp_irq .dstapic = mpc_ioapic_id (ioapic ); /* APIC ID */
382
- mp_irq .dstirq = pin ; /* INTIN# */
383
-
384
- mp_save_irq (& mp_irq );
385
-
367
+ if (mp_register_ioapic_irq (bus_irq , polarity , trigger , gsi ) < 0 )
368
+ return ;
386
369
/*
387
370
* Reset default identity mapping if gsi is also an legacy IRQ,
388
371
* otherwise there will be more than one entry with the same GSI
0 commit comments