diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/probe.c | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 171ca712e523..40e571d3c392 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -744,22 +744,46 @@ static int pci_setup_device(struct pci_dev * dev) | |||
744 | */ | 744 | */ |
745 | if (class == PCI_CLASS_STORAGE_IDE) { | 745 | if (class == PCI_CLASS_STORAGE_IDE) { |
746 | u8 progif; | 746 | u8 progif; |
747 | struct pci_bus_region region; | ||
748 | |||
747 | pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); | 749 | pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); |
748 | if ((progif & 1) == 0) { | 750 | if ((progif & 1) == 0) { |
749 | dev->resource[0].start = 0x1F0; | 751 | struct resource resource = { |
750 | dev->resource[0].end = 0x1F7; | 752 | .start = 0x1F0, |
751 | dev->resource[0].flags = LEGACY_IO_RESOURCE; | 753 | .end = 0x1F7, |
752 | dev->resource[1].start = 0x3F6; | 754 | .flags = LEGACY_IO_RESOURCE, |
753 | dev->resource[1].end = 0x3F6; | 755 | }; |
754 | dev->resource[1].flags = LEGACY_IO_RESOURCE; | 756 | |
757 | pcibios_resource_to_bus(dev, ®ion, &resource); | ||
758 | dev->resource[0].start = region.start; | ||
759 | dev->resource[0].end = region.end; | ||
760 | dev->resource[0].flags = resource.flags; | ||
761 | resource.start = 0x3F6; | ||
762 | resource.end = 0x3F6; | ||
763 | resource.flags = LEGACY_IO_RESOURCE; | ||
764 | pcibios_resource_to_bus(dev, ®ion, &resource); | ||
765 | dev->resource[1].start = region.start; | ||
766 | dev->resource[1].end = region.end; | ||
767 | dev->resource[1].flags = resource.flags; | ||
755 | } | 768 | } |
756 | if ((progif & 4) == 0) { | 769 | if ((progif & 4) == 0) { |
757 | dev->resource[2].start = 0x170; | 770 | struct resource resource = { |
758 | dev->resource[2].end = 0x177; | 771 | .start = 0x170, |
759 | dev->resource[2].flags = LEGACY_IO_RESOURCE; | 772 | .end = 0x177, |
760 | dev->resource[3].start = 0x376; | 773 | .flags = LEGACY_IO_RESOURCE, |
761 | dev->resource[3].end = 0x376; | 774 | }; |
762 | dev->resource[3].flags = LEGACY_IO_RESOURCE; | 775 | |
776 | pcibios_resource_to_bus(dev, ®ion, &resource); | ||
777 | dev->resource[2].start = region.start; | ||
778 | dev->resource[2].end = region.end; | ||
779 | dev->resource[2].flags = resource.flags; | ||
780 | resource.start = 0x376; | ||
781 | resource.end = 0x376; | ||
782 | resource.flags = LEGACY_IO_RESOURCE; | ||
783 | pcibios_resource_to_bus(dev, ®ion, &resource); | ||
784 | dev->resource[3].start = region.start; | ||
785 | dev->resource[3].end = region.end; | ||
786 | dev->resource[3].flags = resource.flags; | ||
763 | } | 787 | } |
764 | } | 788 | } |
765 | break; | 789 | break; |