diff options
Diffstat (limited to 'arch/x86/lguest/boot.c')
-rw-r--r-- | arch/x86/lguest/boot.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index cf4603ba866f..642d8805bc1b 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -856,18 +856,23 @@ static void __init lguest_init_IRQ(void) | |||
856 | } | 856 | } |
857 | 857 | ||
858 | /* | 858 | /* |
859 | * With CONFIG_SPARSE_IRQ, interrupt descriptors are allocated as-needed, so | 859 | * Interrupt descriptors are allocated as-needed, but low-numbered ones are |
860 | * rather than set them in lguest_init_IRQ we are called here every time an | 860 | * reserved by the generic x86 code. So we ignore irq_alloc_desc_at if it |
861 | * lguest device needs an interrupt. | 861 | * tells us the irq is already used: other errors (ie. ENOMEM) we take |
862 | * | 862 | * seriously. |
863 | * FIXME: irq_alloc_desc_at() can fail due to lack of memory, we should | ||
864 | * pass that up! | ||
865 | */ | 863 | */ |
866 | void lguest_setup_irq(unsigned int irq) | 864 | int lguest_setup_irq(unsigned int irq) |
867 | { | 865 | { |
868 | irq_alloc_desc_at(irq, 0); | 866 | int err; |
867 | |||
868 | /* Returns -ve error or vector number. */ | ||
869 | err = irq_alloc_desc_at(irq, 0); | ||
870 | if (err < 0 && err != -EEXIST) | ||
871 | return err; | ||
872 | |||
869 | irq_set_chip_and_handler_name(irq, &lguest_irq_controller, | 873 | irq_set_chip_and_handler_name(irq, &lguest_irq_controller, |
870 | handle_level_irq, "level"); | 874 | handle_level_irq, "level"); |
875 | return 0; | ||
871 | } | 876 | } |
872 | 877 | ||
873 | /* | 878 | /* |