From: [email-masked] on behalf of [email-masked]
To: [email-masked]; [email-masked];

[email-masked]
Subject: [ACPI]
acpi_register_gsi-change-acpi_register_gsi-interface.patch added to -mm
tree

The patch titled

     acpi_register_gsi(): change acpi_register_gsi() interface

has been added to the -mm tree.  Its filename is

     acpi_register_gsi-change-acpi_register_gsi-interface.patch

Patches currently in -mm which might be from [email-masked] are

acpi_register_gsi-change-acpi_register_gsi-interface.patch
acpi_register_gsi-change-acpi-pci-code.patch
acpi_register_gsi-change-hpet-driver.patch
acpi_register_gsi-change-phpacpi-driver.patch
acpi_register_gsi-change-acpi-based-8250-driver.patch
acpi_register_gsi-change-ia64-iosapic-code.patch

From: Kenji Kaneshige <[email-masked]>

Current acpi_register_gsi() function has no way to indicate errors to its
callers even though acpi_register_gsi() can fail to register gsi because of
some reasons (out of memory, lack of interrupt vectors, incorrect BIOS, and so
on).  As a result, caller of acpi_register_gsi() cannot handle the case that
acpi_register_gsi() fails.  I think failure of acpi_register_gsi() should be
handled properly.

This series of patches changes acpi_register_gsi() to return negative value on
error, and also changes callers of acpi_register_gsi() to handle failure of
acpi_register_gsi().

This patch changes the type of return value of acpi_register_gsi() from
"unsigned int" to "int" to indicate an error.  If acpi_register_gsi() fails to
register gsi, it returns negative value.

Signed-off-by: Kenji Kaneshige <[email-masked]>
Cc: <[email-masked]>
Signed-off-by: Andrew Morton <[email-masked]>
Index: to-akpm/arch/i386/kernel/acpi/boot.c
===================================================================
--- to-akpm.orig/arch/i386/kernel/acpi/boot.c
+++ to-akpm/arch/i386/kernel/acpi/boot.c
@@ -457,7 +457,11 @@ int acpi_gsi_to_irq(u32 gsi, unsigned in
 	return 0;
 }
 
-unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
+/*
+ * success: return IRQ number (>=0)
+ * failure: return < 0
+ */
+int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
 {
 	unsigned int irq;
 	unsigned int plat_gsi = gsi;
Index: to-akpm/arch/ia64/kernel/acpi.c
===================================================================
--- to-akpm.orig/arch/ia64/kernel/acpi.c
+++ to-akpm/arch/ia64/kernel/acpi.c
@@ -565,7 +565,11 @@ acpi_numa_arch_fixup (void)
 }
 #endif /* CONFIG_ACPI_NUMA */
 
-unsigned int
+/*
+ * success: return IRQ number (>=0)
+ * failure: return < 0
+ */
+int
 acpi_register_gsi (u32 gsi, int edge_level, int active_high_low)
 {
 	if (has_8259 && gsi < 16)
Index: to-akpm/include/linux/acpi.h
===================================================================
--- to-akpm.orig/include/linux/acpi.h
+++ to-akpm/include/linux/acpi.h
@@ -432,7 +432,7 @@ static inline int acpi_boot_table_init(v
 
 #endif 	/*!CONFIG_ACPI_BOOT*/
 
-unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
+int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
 int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
 /*