diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-04-28 16:34:34 -0600 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-29 03:22:28 -0400 |
commit | dbddd0383c59d588f8db5e773b062756e39117ec (patch) | |
tree | 77009fb218b4fc21090ae83105aa0f84664ae61c /drivers/pnp/pnpbios | |
parent | a50b6d7b8d7e1a8b13bd1be65a865b115e1190d9 (diff) | |
download | talos-op-linux-dbddd0383c59d588f8db5e773b062756e39117ec.tar.gz talos-op-linux-dbddd0383c59d588f8db5e773b062756e39117ec.zip |
PNP: make generic pnp_add_irq_resource()
Add a pnp_add_irq_resource() that can be used by all the PNP
backends. This consolidates a little more pnp_resource_table
knowledge into one place.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/pnpbios')
-rw-r--r-- | drivers/pnp/pnpbios/rsparser.c | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c index d3b0a4e53692..845730c57edc 100644 --- a/drivers/pnp/pnpbios/rsparser.c +++ b/drivers/pnp/pnpbios/rsparser.c @@ -54,28 +54,6 @@ inline void pcibios_penalize_isa_irq(int irq, int active) * Allocated Resources */ -static void pnpbios_parse_allocated_irqresource(struct pnp_dev *dev, int irq) -{ - struct resource *res; - int i; - - for (i = 0; i < PNP_MAX_IRQ; i++) { - res = pnp_get_resource(dev, IORESOURCE_IRQ, i); - if (!pnp_resource_valid(res)) - break; - } - - if (i < PNP_MAX_IRQ) { - res->flags = IORESOURCE_IRQ; // Also clears _UNSET flag - if (irq == -1) { - res->flags |= IORESOURCE_DISABLED; - return; - } - res->start = res->end = (unsigned long)irq; - pcibios_penalize_isa_irq(irq, 1); - } -} - static void pnpbios_parse_allocated_dmaresource(struct pnp_dev *dev, int dma) { struct resource *res; @@ -148,7 +126,7 @@ static unsigned char *pnpbios_parse_allocated_resource_data(struct pnp_dev *dev, unsigned char *end) { unsigned int len, tag; - int io, size, mask, i; + int io, size, mask, i, flags; if (!p) return NULL; @@ -205,12 +183,17 @@ static unsigned char *pnpbios_parse_allocated_resource_data(struct pnp_dev *dev, case SMALL_TAG_IRQ: if (len < 2 || len > 3) goto len_err; + flags = 0; io = -1; mask = p[1] + p[2] * 256; for (i = 0; i < 16; i++, mask = mask >> 1) if (mask & 0x01) io = i; - pnpbios_parse_allocated_irqresource(dev, io); + if (io != -1) + pcibios_penalize_isa_irq(io, 1); + else + flags = IORESOURCE_DISABLED; + pnp_add_irq_resource(dev, io, flags); break; case SMALL_TAG_DMA: |