ACPI: Avoid calling request_irq() many times for the same interrupt
authorRafael J. Wysocki <rjw@sisk.pl>
Tue, 8 Feb 2011 22:48:16 +0000 (23:48 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Thu, 24 Feb 2011 18:59:00 +0000 (19:59 +0100)
commit23fe36306ea489eef7dd88506bdcefdc8da39c91
treee788dffdc10ae283f737604f7cb476c13bcc1bce
parent2aa15890f3c191326678f1bd68af61ec6b8753ec
ACPI: Avoid calling request_irq() many times for the same interrupt

In principle acpi_os_install_interrupt_handler() may be called
multiple times for different interrupts, either from
acpi_ev_get_gpe_xrupt_block(), or from acpi_ev_install_sci_handler().
However, it always attempts to request the same interrupt,
acpi_gbl_FADT.sci_interrupt and it doesn't check whether or not this
interrupt has already been requested.

Modify this function so that it refuses to request interrupts other
than acpi_gbl_FADT.sci_interrupt and change
acpi_os_remove_interrupt_handler() so that it refuses to free such
interrupts.  Use the observation that the only supported ACPI
interrupt must be equal to acpi_gbl_FADT.sci_interrupt and drop an
unnecessary variable acpi_irq_irq.

This change has been tested on Toshiba Portege R500 and HP nx6325
without introducing any visible problems.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
drivers/acpi/osl.c