diff options
Diffstat (limited to 'drivers/pnp/quirks.c')
-rw-r--r-- | drivers/pnp/quirks.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index c47dd252f449..d049a2279fea 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) | |||
138 | 138 | ||
139 | pci_start = pci_resource_start(pdev, i); | 139 | pci_start = pci_resource_start(pdev, i); |
140 | pci_end = pci_resource_end(pdev, i); | 140 | pci_end = pci_resource_end(pdev, i); |
141 | for (j = 0; j < PNP_MAX_MEM; j++) { | 141 | for (j = 0; |
142 | if (!pnp_mem_valid(dev, j) || | 142 | (res = pnp_get_resource(dev, IORESOURCE_MEM, j)); |
143 | pnp_mem_len(dev, j) == 0) | 143 | j++) { |
144 | if (res->flags & IORESOURCE_UNSET || | ||
145 | (res->start == 0 && res->end == 0)) | ||
144 | continue; | 146 | continue; |
145 | 147 | ||
146 | pnp_start = pnp_mem_start(dev, j); | 148 | pnp_start = res->start; |
147 | pnp_end = pnp_mem_end(dev, j); | 149 | pnp_end = res->end; |
148 | 150 | ||
149 | /* | 151 | /* |
150 | * If the PNP region doesn't overlap the PCI | 152 | * If the PNP region doesn't overlap the PCI |
@@ -177,7 +179,6 @@ static void quirk_system_pci_resources(struct pnp_dev *dev) | |||
177 | pci_name(pdev), i, | 179 | pci_name(pdev), i, |
178 | (unsigned long long) pci_start, | 180 | (unsigned long long) pci_start, |
179 | (unsigned long long) pci_end); | 181 | (unsigned long long) pci_end); |
180 | res = pnp_get_resource(dev, IORESOURCE_MEM, j); | ||
181 | res->flags = 0; | 182 | res->flags = 0; |
182 | } | 183 | } |
183 | } | 184 | } |