Skip to content

Commit

Permalink
[ACPI] acpi_register_gsi() can return error
Browse files Browse the repository at this point in the history
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 <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Kenji Kaneshige authored and Len Brown committed Aug 5, 2005
1 parent bd6dbdf commit 1f3a6a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion arch/i386/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,11 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
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;
Expand Down
6 changes: 5 additions & 1 deletion arch/ia64/kernel/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion include/linux/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ static inline int acpi_boot_table_init(void)

#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);

/*
Expand Down

0 comments on commit 1f3a6a1

Please sign in to comment.