From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx> Make acpi_enable_gpe() refuse to enable a given GPE if there is no way to handle it and return an error instead. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx> --- Updated as requested by Bob. --- drivers/acpi/acpica/evxfgpe.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) Index: linux-pm/drivers/acpi/acpica/evxfgpe.c =================================================================== --- linux-pm.orig/drivers/acpi/acpica/evxfgpe.c +++ linux-pm/drivers/acpi/acpica/evxfgpe.c @@ -118,7 +118,7 @@ ACPI_EXPORT_SYMBOL(acpi_update_all_gpes) acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number) { - acpi_status status = AE_BAD_PARAMETER; + acpi_status status; struct acpi_gpe_event_info *gpe_event_info; acpi_cpu_flags flags; @@ -129,7 +129,12 @@ acpi_status acpi_enable_gpe(acpi_handle /* Ensure that we have a valid GPE number */ gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); - if (gpe_event_info) { + if (!gpe_event_info) { + status = AE_BAD_PARAMETER; + } else if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == + ACPI_GPE_DISPATCH_NONE) { + status = AE_NO_HANDLER; + } else { status = acpi_ev_add_gpe_reference(gpe_event_info); } -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html