summaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpbios
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-29 00:34:35 +0200
committerLen Brown <len.brown@intel.com>2008-04-29 09:22:28 +0200
commitdc16f5f2ede8cc2acf8ac22857a7fecf3a4296c2 (patch)
treeb4ba965b7c5e1e6011697160aa5346b63afbbbf9 /drivers/pnp/pnpbios
parentPNP: make generic pnp_add_irq_resource() (diff)
downloadlinux-dc16f5f2ede8cc2acf8ac22857a7fecf3a4296c2.tar.xz
linux-dc16f5f2ede8cc2acf8ac22857a7fecf3a4296c2.zip
PNP: make generic pnp_add_dma_resource()
Add a pnp_add_dma_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.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c
index 845730c57edc..7f8d65728599 100644
--- a/drivers/pnp/pnpbios/rsparser.c
+++ b/drivers/pnp/pnpbios/rsparser.c
@@ -54,27 +54,6 @@ inline void pcibios_penalize_isa_irq(int irq, int active)
* Allocated Resources
*/
-static void pnpbios_parse_allocated_dmaresource(struct pnp_dev *dev, int dma)
-{
- struct resource *res;
- int i;
-
- for (i = 0; i < PNP_MAX_DMA; i++) {
- res = pnp_get_resource(dev, IORESOURCE_DMA, i);
- if (!pnp_resource_valid(res))
- break;
- }
-
- if (i < PNP_MAX_DMA) {
- res->flags = IORESOURCE_DMA; // Also clears _UNSET flag
- if (dma == -1) {
- res->flags |= IORESOURCE_DISABLED;
- return;
- }
- res->start = res->end = (unsigned long)dma;
- }
-}
-
static void pnpbios_parse_allocated_ioresource(struct pnp_dev *dev,
int io, int len)
{
@@ -199,12 +178,15 @@ static unsigned char *pnpbios_parse_allocated_resource_data(struct pnp_dev *dev,
case SMALL_TAG_DMA:
if (len != 2)
goto len_err;
+ flags = 0;
io = -1;
mask = p[1];
for (i = 0; i < 8; i++, mask = mask >> 1)
if (mask & 0x01)
io = i;
- pnpbios_parse_allocated_dmaresource(dev, io);
+ if (io == -1)
+ flags = IORESOURCE_DISABLED;
+ pnp_add_dma_resource(dev, io, flags);
break;
case SMALL_TAG_PORT: