summaryrefslogtreecommitdiffstats
path: root/drivers/pnp/quirks.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 16:34:26 -0600
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:26 -0400
commit95ab3669f7830682c7762e9c305a0c1dd44454cc (patch)
tree2a858bc0a51d46a5873b3b3fe9fbbbecc8c32aa8 /drivers/pnp/quirks.c
parentf6505fef18644557f732468c1f22f84560d8a819 (diff)
downloadop-kernel-dev-95ab3669f7830682c7762e9c305a0c1dd44454cc.zip
op-kernel-dev-95ab3669f7830682c7762e9c305a0c1dd44454cc.tar.gz
PNP: remove PNP_MAX_* uses
Remove some PNP_MAX_* uses. The pnp_resource_table isn't dynamic yet, but with pnp_get_resource(), we can start moving away from the table size constants. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/quirks.c')
-rw-r--r--drivers/pnp/quirks.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index c47dd25..d049a22 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -138,13 +138,15 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
pci_start = pci_resource_start(pdev, i);
pci_end = pci_resource_end(pdev, i);
- for (j = 0; j < PNP_MAX_MEM; j++) {
- if (!pnp_mem_valid(dev, j) ||
- pnp_mem_len(dev, j) == 0)
+ for (j = 0;
+ (res = pnp_get_resource(dev, IORESOURCE_MEM, j));
+ j++) {
+ if (res->flags & IORESOURCE_UNSET ||
+ (res->start == 0 && res->end == 0))
continue;
- pnp_start = pnp_mem_start(dev, j);
- pnp_end = pnp_mem_end(dev, j);
+ pnp_start = res->start;
+ pnp_end = res->end;
/*
* If the PNP region doesn't overlap the PCI
@@ -177,7 +179,6 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
pci_name(pdev), i,
(unsigned long long) pci_start,
(unsigned long long) pci_end);
- res = pnp_get_resource(dev, IORESOURCE_MEM, j);
res->flags = 0;
}
}
OpenPOWER on IntegriCloud