diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2006-02-14 13:53:02 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-14 16:09:34 -0800 |
commit | be5efffb762fa4a7b9a7a45ebf34b13e3bf5a2d8 (patch) | |
tree | b5bf63cab3daf805c89d8a3438b19bd96964d64c /drivers/char | |
parent | da965822abd18a17d7cffe1d511f48951c82dfb6 (diff) | |
download | linux-stable-be5efffb762fa4a7b9a7a45ebf34b13e3bf5a2d8.tar.gz linux-stable-be5efffb762fa4a7b9a7a45ebf34b13e3bf5a2d8.tar.bz2 linux-stable-be5efffb762fa4a7b9a7a45ebf34b13e3bf5a2d8.zip |
[PATCH] HPET: handle multiple ACPI EXTENDED_IRQ resources
When the _CRS for a single HPET contains multiple EXTENDED_IRQ resources,
we overwrote hdp->hd_nirqs every time we found one.
So the driver worked when all the IRQs were described in a single
EXTENDED_IRQ resource, but failed when multiple resources were used.
(Strictly speaking, I think the latter is actually more correct, but both
styles have been used.)
Someday we should remove all the ACPI stuff from hpet.c and use PNP driver
registration instead. But currently PNP_MAX_IRQ is 2, and HPETs often have
more IRQs. Hint, hint, Adam :-)
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Bob Picco <robert.picco@hp.com>
Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/hpet.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 66a2fee06eb9..ef140ebde117 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c @@ -956,22 +956,18 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data) } } else if (res->type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) { struct acpi_resource_extended_irq *irqp; - int i; + int i, irq; irqp = &res->data.extended_irq; - if (irqp->interrupt_count > 0) { - hdp->hd_nirqs = irqp->interrupt_count; - - for (i = 0; i < hdp->hd_nirqs; i++) { - int rc = - acpi_register_gsi(irqp->interrupts[i], - irqp->triggering, - irqp->polarity); - if (rc < 0) - return AE_ERROR; - hdp->hd_irq[i] = rc; - } + for (i = 0; i < irqp->interrupt_count; i++) { + irq = acpi_register_gsi(irqp->interrupts[i], + irqp->triggering, irqp->polarity); + if (irq < 0) + return AE_ERROR; + + hdp->hd_irq[hdp->hd_nirqs] = irq; + hdp->hd_nirqs++; } } |