diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2005-07-28 14:42:00 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-08-04 22:12:08 -0400 |
commit | 1f3a6a15771ed70d3b2581663dcc6b9bc134baa5 (patch) | |
tree | 3ff04aafd6c5ea69a0011662b6aa5ed2a6a2d623 | |
parent | bd6dbdf3c7b9784fbf5d8500e427a954e27a976a (diff) |
[ACPI] acpi_register_gsi() can return error
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>
-rw-r--r-- | arch/i386/kernel/acpi/boot.c | 6 | ||||
-rw-r--r-- | arch/ia64/kernel/acpi.c | 6 | ||||
-rw-r--r-- | include/linux/acpi.h | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index 848bb97af7ca..364f4b7c4e3e 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c | |||
@@ -457,7 +457,11 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) | |||
457 | return 0; | 457 | return 0; |
458 | } | 458 | } |
459 | 459 | ||
460 | unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low) | 460 | /* |
461 | * success: return IRQ number (>=0) | ||
462 | * failure: return < 0 | ||
463 | */ | ||
464 | int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low) | ||
461 | { | 465 | { |
462 | unsigned int irq; | 466 | unsigned int irq; |
463 | unsigned int plat_gsi = gsi; | 467 | unsigned int plat_gsi = gsi; |
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 1c118b72df3c..7513ff9361a0 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -565,7 +565,11 @@ acpi_numa_arch_fixup (void) | |||
565 | } | 565 | } |
566 | #endif /* CONFIG_ACPI_NUMA */ | 566 | #endif /* CONFIG_ACPI_NUMA */ |
567 | 567 | ||
568 | unsigned int | 568 | /* |
569 | * success: return IRQ number (>=0) | ||
570 | * failure: return < 0 | ||
571 | */ | ||
572 | int | ||
569 | acpi_register_gsi (u32 gsi, int edge_level, int active_high_low) | 573 | acpi_register_gsi (u32 gsi, int edge_level, int active_high_low) |
570 | { | 574 | { |
571 | if (has_8259 && gsi < 16) | 575 | if (has_8259 && gsi < 16) |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index ca0cd240cee0..9378bcde73a4 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -432,7 +432,7 @@ static inline int acpi_boot_table_init(void) | |||
432 | 432 | ||
433 | #endif /*!CONFIG_ACPI_BOOT*/ | 433 | #endif /*!CONFIG_ACPI_BOOT*/ |
434 | 434 | ||
435 | unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low); | 435 | int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low); |
436 | int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); | 436 | int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); |
437 | 437 | ||
438 | /* | 438 | /* |