summaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpbios
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 16:34:37 -0600
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:29 -0400
commitd6180f36617953990bf90d4c1ff85b77e9995cd1 (patch)
treea9fa336f7cb1f99a62c859926c6cbcfb53f5b81e /drivers/pnp/pnpbios
parentcc8c2e308194f0997c718c7c735550ff06754d20 (diff)
downloadlinux-stable-d6180f36617953990bf90d4c1ff85b77e9995cd1.tar.gz
linux-stable-d6180f36617953990bf90d4c1ff85b77e9995cd1.tar.bz2
linux-stable-d6180f36617953990bf90d4c1ff85b77e9995cd1.zip
PNP: make generic pnp_add_mem_resource()
Add a pnp_add_mem_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.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c
index 8c83bc16a9be..ed63ecd9bf40 100644
--- a/drivers/pnp/pnpbios/rsparser.c
+++ b/drivers/pnp/pnpbios/rsparser.c
@@ -67,26 +67,15 @@ static void pnpbios_parse_allocated_ioresource(struct pnp_dev *dev,
}
static void pnpbios_parse_allocated_memresource(struct pnp_dev *dev,
- int mem, int len)
+ int start, int len)
{
- struct resource *res;
- int i;
+ int flags = 0;
+ int end = start + len - 1;
- for (i = 0; i < PNP_MAX_MEM; i++) {
- res = pnp_get_resource(dev, IORESOURCE_MEM, i);
- if (!pnp_resource_valid(res))
- break;
- }
+ if (len <= 0)
+ flags |= IORESOURCE_DISABLED;
- if (i < PNP_MAX_MEM) {
- res->flags = IORESOURCE_MEM; // Also clears _UNSET flag
- if (len <= 0) {
- res->flags |= IORESOURCE_DISABLED;
- return;
- }
- res->start = (unsigned long)mem;
- res->end = (unsigned long)(mem + len - 1);
- }
+ pnp_add_mem_resource(dev, start, end, flags);
}
static unsigned char *pnpbios_parse_allocated_resource_data(struct pnp_dev *dev,