diff options
Diffstat (limited to 'drivers/parisc/dino.c')
-rw-r--r-- | drivers/parisc/dino.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index 432d4bbcc62a..ffddc4f64268 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c | |||
@@ -174,7 +174,7 @@ static int dino_cfg_read(struct pci_bus *bus, unsigned int devfn, int where, | |||
174 | int size, u32 *val) | 174 | int size, u32 *val) |
175 | { | 175 | { |
176 | struct dino_device *d = DINO_DEV(parisc_walk_tree(bus->bridge)); | 176 | struct dino_device *d = DINO_DEV(parisc_walk_tree(bus->bridge)); |
177 | u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary; | 177 | u32 local_bus = (bus->parent == NULL) ? 0 : bus->busn_res.start; |
178 | u32 v = DINO_CFG_TOK(local_bus, devfn, where & ~3); | 178 | u32 v = DINO_CFG_TOK(local_bus, devfn, where & ~3); |
179 | void __iomem *base_addr = d->hba.base_addr; | 179 | void __iomem *base_addr = d->hba.base_addr; |
180 | unsigned long flags; | 180 | unsigned long flags; |
@@ -209,7 +209,7 @@ static int dino_cfg_write(struct pci_bus *bus, unsigned int devfn, int where, | |||
209 | int size, u32 val) | 209 | int size, u32 val) |
210 | { | 210 | { |
211 | struct dino_device *d = DINO_DEV(parisc_walk_tree(bus->bridge)); | 211 | struct dino_device *d = DINO_DEV(parisc_walk_tree(bus->bridge)); |
212 | u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary; | 212 | u32 local_bus = (bus->parent == NULL) ? 0 : bus->busn_res.start; |
213 | u32 v = DINO_CFG_TOK(local_bus, devfn, where & ~3); | 213 | u32 v = DINO_CFG_TOK(local_bus, devfn, where & ~3); |
214 | void __iomem *base_addr = d->hba.base_addr; | 214 | void __iomem *base_addr = d->hba.base_addr; |
215 | unsigned long flags; | 215 | unsigned long flags; |
@@ -554,7 +554,7 @@ dino_fixup_bus(struct pci_bus *bus) | |||
554 | struct dino_device *dino_dev = DINO_DEV(parisc_walk_tree(bus->bridge)); | 554 | struct dino_device *dino_dev = DINO_DEV(parisc_walk_tree(bus->bridge)); |
555 | 555 | ||
556 | DBG(KERN_WARNING "%s(0x%p) bus %d platform_data 0x%p\n", | 556 | DBG(KERN_WARNING "%s(0x%p) bus %d platform_data 0x%p\n", |
557 | __func__, bus, bus->secondary, | 557 | __func__, bus, bus->busn_res.start, |
558 | bus->bridge->platform_data); | 558 | bus->bridge->platform_data); |
559 | 559 | ||
560 | /* Firmware doesn't set up card-mode dino, so we have to */ | 560 | /* Firmware doesn't set up card-mode dino, so we have to */ |
@@ -898,6 +898,7 @@ static int __init dino_probe(struct parisc_device *dev) | |||
898 | LIST_HEAD(resources); | 898 | LIST_HEAD(resources); |
899 | struct pci_bus *bus; | 899 | struct pci_bus *bus; |
900 | unsigned long hpa = dev->hpa.start; | 900 | unsigned long hpa = dev->hpa.start; |
901 | int max; | ||
901 | 902 | ||
902 | name = "Dino"; | 903 | name = "Dino"; |
903 | if (is_card_dino(&dev->id)) { | 904 | if (is_card_dino(&dev->id)) { |
@@ -983,6 +984,10 @@ static int __init dino_probe(struct parisc_device *dev) | |||
983 | if (dino_dev->hba.gmmio_space.flags) | 984 | if (dino_dev->hba.gmmio_space.flags) |
984 | pci_add_resource(&resources, &dino_dev->hba.gmmio_space); | 985 | pci_add_resource(&resources, &dino_dev->hba.gmmio_space); |
985 | 986 | ||
987 | dino_dev->hba.bus_num.start = dino_current_bus; | ||
988 | dino_dev->hba.bus_num.end = 255; | ||
989 | dino_dev->hba.bus_num.flags = IORESOURCE_BUS; | ||
990 | pci_add_resource(&resources, &dino_dev->hba.bus_num); | ||
986 | /* | 991 | /* |
987 | ** It's not used to avoid chicken/egg problems | 992 | ** It's not used to avoid chicken/egg problems |
988 | ** with configuration accessor functions. | 993 | ** with configuration accessor functions. |
@@ -998,12 +1003,13 @@ static int __init dino_probe(struct parisc_device *dev) | |||
998 | return 0; | 1003 | return 0; |
999 | } | 1004 | } |
1000 | 1005 | ||
1001 | bus->subordinate = pci_scan_child_bus(bus); | 1006 | max = pci_scan_child_bus(bus); |
1007 | pci_bus_update_busn_res_end(bus, max); | ||
1002 | 1008 | ||
1003 | /* This code *depends* on scanning being single threaded | 1009 | /* This code *depends* on scanning being single threaded |
1004 | * if it isn't, this global bus number count will fail | 1010 | * if it isn't, this global bus number count will fail |
1005 | */ | 1011 | */ |
1006 | dino_current_bus = bus->subordinate + 1; | 1012 | dino_current_bus = max + 1; |
1007 | pci_bus_assign_resources(bus); | 1013 | pci_bus_assign_resources(bus); |
1008 | pci_bus_add_devices(bus); | 1014 | pci_bus_add_devices(bus); |
1009 | return 0; | 1015 | return 0; |