diff options
Diffstat (limited to 'arch/ia64/pci/pci.c')
-rw-r--r-- | arch/ia64/pci/pci.c | 55 |
1 files changed, 2 insertions, 53 deletions
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index f82f5d4b65fd..d1ce3200147c 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -320,7 +320,8 @@ static __devinit acpi_status add_window(struct acpi_resource *res, void *data) | |||
320 | * Ignore these tiny memory ranges */ | 320 | * Ignore these tiny memory ranges */ |
321 | if (!((window->resource.flags & IORESOURCE_MEM) && | 321 | if (!((window->resource.flags & IORESOURCE_MEM) && |
322 | (window->resource.end - window->resource.start < 16))) | 322 | (window->resource.end - window->resource.start < 16))) |
323 | pci_add_resource(&info->resources, &window->resource); | 323 | pci_add_resource_offset(&info->resources, &window->resource, |
324 | window->offset); | ||
324 | 325 | ||
325 | return AE_OK; | 326 | return AE_OK; |
326 | } | 327 | } |
@@ -395,54 +396,6 @@ out1: | |||
395 | return NULL; | 396 | return NULL; |
396 | } | 397 | } |
397 | 398 | ||
398 | void pcibios_resource_to_bus(struct pci_dev *dev, | ||
399 | struct pci_bus_region *region, struct resource *res) | ||
400 | { | ||
401 | struct pci_controller *controller = PCI_CONTROLLER(dev); | ||
402 | unsigned long offset = 0; | ||
403 | int i; | ||
404 | |||
405 | for (i = 0; i < controller->windows; i++) { | ||
406 | struct pci_window *window = &controller->window[i]; | ||
407 | if (!(window->resource.flags & res->flags)) | ||
408 | continue; | ||
409 | if (window->resource.start > res->start) | ||
410 | continue; | ||
411 | if (window->resource.end < res->end) | ||
412 | continue; | ||
413 | offset = window->offset; | ||
414 | break; | ||
415 | } | ||
416 | |||
417 | region->start = res->start - offset; | ||
418 | region->end = res->end - offset; | ||
419 | } | ||
420 | EXPORT_SYMBOL(pcibios_resource_to_bus); | ||
421 | |||
422 | void pcibios_bus_to_resource(struct pci_dev *dev, | ||
423 | struct resource *res, struct pci_bus_region *region) | ||
424 | { | ||
425 | struct pci_controller *controller = PCI_CONTROLLER(dev); | ||
426 | unsigned long offset = 0; | ||
427 | int i; | ||
428 | |||
429 | for (i = 0; i < controller->windows; i++) { | ||
430 | struct pci_window *window = &controller->window[i]; | ||
431 | if (!(window->resource.flags & res->flags)) | ||
432 | continue; | ||
433 | if (window->resource.start - window->offset > region->start) | ||
434 | continue; | ||
435 | if (window->resource.end - window->offset < region->end) | ||
436 | continue; | ||
437 | offset = window->offset; | ||
438 | break; | ||
439 | } | ||
440 | |||
441 | res->start = region->start + offset; | ||
442 | res->end = region->end + offset; | ||
443 | } | ||
444 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
445 | |||
446 | static int __devinit is_valid_resource(struct pci_dev *dev, int idx) | 399 | static int __devinit is_valid_resource(struct pci_dev *dev, int idx) |
447 | { | 400 | { |
448 | unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM; | 401 | unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM; |
@@ -464,15 +417,11 @@ static int __devinit is_valid_resource(struct pci_dev *dev, int idx) | |||
464 | static void __devinit | 417 | static void __devinit |
465 | pcibios_fixup_resources(struct pci_dev *dev, int start, int limit) | 418 | pcibios_fixup_resources(struct pci_dev *dev, int start, int limit) |
466 | { | 419 | { |
467 | struct pci_bus_region region; | ||
468 | int i; | 420 | int i; |
469 | 421 | ||
470 | for (i = start; i < limit; i++) { | 422 | for (i = start; i < limit; i++) { |
471 | if (!dev->resource[i].flags) | 423 | if (!dev->resource[i].flags) |
472 | continue; | 424 | continue; |
473 | region.start = dev->resource[i].start; | ||
474 | region.end = dev->resource[i].end; | ||
475 | pcibios_bus_to_resource(dev, &dev->resource[i], ®ion); | ||
476 | if ((is_valid_resource(dev, i))) | 425 | if ((is_valid_resource(dev, i))) |
477 | pci_claim_resource(dev, i); | 426 | pci_claim_resource(dev, i); |
478 | } | 427 | } |