aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/quirks.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp/quirks.c')
-rw-r--r--drivers/pnp/quirks.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index 55f55ed72dc7..0bdf9b8a5e58 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -245,15 +245,17 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
245 */ 245 */
246 for_each_pci_dev(pdev) { 246 for_each_pci_dev(pdev) {
247 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { 247 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
248 if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM) || 248 unsigned int type;
249 pci_resource_len(pdev, i) == 0) 249
250 type = pci_resource_flags(pdev, i) &
251 (IORESOURCE_IO | IORESOURCE_MEM);
252 if (!type || pci_resource_len(pdev, i) == 0)
250 continue; 253 continue;
251 254
252 pci_start = pci_resource_start(pdev, i); 255 pci_start = pci_resource_start(pdev, i);
253 pci_end = pci_resource_end(pdev, i); 256 pci_end = pci_resource_end(pdev, i);
254 for (j = 0; 257 for (j = 0;
255 (res = pnp_get_resource(dev, IORESOURCE_MEM, j)); 258 (res = pnp_get_resource(dev, type, j)); j++) {
256 j++) {
257 if (res->start == 0 && res->end == 0) 259 if (res->start == 0 && res->end == 0)
258 continue; 260 continue;
259 261
@@ -283,9 +285,10 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
283 * the PCI region, and that might prevent a PCI 285 * the PCI region, and that might prevent a PCI
284 * driver from requesting its resources. 286 * driver from requesting its resources.
285 */ 287 */
286 dev_warn(&dev->dev, "mem resource " 288 dev_warn(&dev->dev, "%s resource "
287 "(0x%llx-0x%llx) overlaps %s BAR %d " 289 "(0x%llx-0x%llx) overlaps %s BAR %d "
288 "(0x%llx-0x%llx), disabling\n", 290 "(0x%llx-0x%llx), disabling\n",
291 pnp_resource_type_name(res),
289 (unsigned long long) pnp_start, 292 (unsigned long long) pnp_start,
290 (unsigned long long) pnp_end, 293 (unsigned long long) pnp_end,
291 pci_name(pdev), i, 294 pci_name(pdev), i,