]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pnp/quirks.c
PNP: remove PNP_MAX_* uses
[linux-2.6-omap-h63xx.git] / drivers / pnp / quirks.c
index c47dd252f4491896ebed25eb91620a7b46af2b9b..d049a2279feac460d0dda5e4a21f2471c1b059b0 100644 (file)
@@ -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;
                        }
                }