diff options
Diffstat (limited to 'drivers/parisc/dino.c')
-rw-r--r-- | drivers/parisc/dino.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index bcd5d54b7d4d..7ff10c1e8664 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c | |||
@@ -562,19 +562,6 @@ dino_fixup_bus(struct pci_bus *bus) | |||
562 | /* Firmware doesn't set up card-mode dino, so we have to */ | 562 | /* Firmware doesn't set up card-mode dino, so we have to */ |
563 | if (is_card_dino(&dino_dev->hba.dev->id)) { | 563 | if (is_card_dino(&dino_dev->hba.dev->id)) { |
564 | dino_card_setup(bus, dino_dev->hba.base_addr); | 564 | dino_card_setup(bus, dino_dev->hba.base_addr); |
565 | } else if(bus->parent == NULL) { | ||
566 | /* must have a dino above it, reparent the resources | ||
567 | * into the dino window */ | ||
568 | int i; | ||
569 | struct resource *res = &dino_dev->hba.lmmio_space; | ||
570 | |||
571 | bus->resource[0] = &(dino_dev->hba.io_space); | ||
572 | for(i = 0; i < DINO_MAX_LMMIO_RESOURCES; i++) { | ||
573 | if(res[i].flags == 0) | ||
574 | break; | ||
575 | bus->resource[i+1] = &res[i]; | ||
576 | } | ||
577 | |||
578 | } else if (bus->parent) { | 565 | } else if (bus->parent) { |
579 | int i; | 566 | int i; |
580 | 567 | ||
@@ -927,6 +914,7 @@ static int __init dino_probe(struct parisc_device *dev) | |||
927 | const char *version = "unknown"; | 914 | const char *version = "unknown"; |
928 | char *name; | 915 | char *name; |
929 | int is_cujo = 0; | 916 | int is_cujo = 0; |
917 | LIST_HEAD(resources); | ||
930 | struct pci_bus *bus; | 918 | struct pci_bus *bus; |
931 | unsigned long hpa = dev->hpa.start; | 919 | unsigned long hpa = dev->hpa.start; |
932 | 920 | ||
@@ -1003,26 +991,37 @@ static int __init dino_probe(struct parisc_device *dev) | |||
1003 | 991 | ||
1004 | dev->dev.platform_data = dino_dev; | 992 | dev->dev.platform_data = dino_dev; |
1005 | 993 | ||
994 | pci_add_resource(&resources, &dino_dev->hba.io_space); | ||
995 | if (dino_dev->hba.lmmio_space.flags) | ||
996 | pci_add_resource(&resources, &dino_dev->hba.lmmio_space); | ||
997 | if (dino_dev->hba.elmmio_space.flags) | ||
998 | pci_add_resource(&resources, &dino_dev->hba.elmmio_space); | ||
999 | if (dino_dev->hba.gmmio_space.flags) | ||
1000 | pci_add_resource(&resources, &dino_dev->hba.gmmio_space); | ||
1001 | |||
1006 | /* | 1002 | /* |
1007 | ** It's not used to avoid chicken/egg problems | 1003 | ** It's not used to avoid chicken/egg problems |
1008 | ** with configuration accessor functions. | 1004 | ** with configuration accessor functions. |
1009 | */ | 1005 | */ |
1010 | dino_dev->hba.hba_bus = bus = pci_scan_bus_parented(&dev->dev, | 1006 | dino_dev->hba.hba_bus = bus = pci_create_root_bus(&dev->dev, |
1011 | dino_current_bus, &dino_cfg_ops, NULL); | 1007 | dino_current_bus, &dino_cfg_ops, NULL, &resources); |
1012 | 1008 | if (!bus) { | |
1013 | if(bus) { | ||
1014 | /* This code *depends* on scanning being single threaded | ||
1015 | * if it isn't, this global bus number count will fail | ||
1016 | */ | ||
1017 | dino_current_bus = bus->subordinate + 1; | ||
1018 | pci_bus_assign_resources(bus); | ||
1019 | pci_bus_add_devices(bus); | ||
1020 | } else { | ||
1021 | printk(KERN_ERR "ERROR: failed to scan PCI bus on %s (duplicate bus number %d?)\n", | 1009 | printk(KERN_ERR "ERROR: failed to scan PCI bus on %s (duplicate bus number %d?)\n", |
1022 | dev_name(&dev->dev), dino_current_bus); | 1010 | dev_name(&dev->dev), dino_current_bus); |
1011 | pci_free_resource_list(&resources); | ||
1023 | /* increment the bus number in case of duplicates */ | 1012 | /* increment the bus number in case of duplicates */ |
1024 | dino_current_bus++; | 1013 | dino_current_bus++; |
1014 | return 0; | ||
1025 | } | 1015 | } |
1016 | |||
1017 | bus->subordinate = pci_scan_child_bus(bus); | ||
1018 | |||
1019 | /* This code *depends* on scanning being single threaded | ||
1020 | * if it isn't, this global bus number count will fail | ||
1021 | */ | ||
1022 | dino_current_bus = bus->subordinate + 1; | ||
1023 | pci_bus_assign_resources(bus); | ||
1024 | pci_bus_add_devices(bus); | ||
1026 | return 0; | 1025 | return 0; |
1027 | } | 1026 | } |
1028 | 1027 | ||