]> err.no Git - linux-2.6/commitdiff
[PATCH] powerpc/PCI hotplug: remove rpaphp_fixup_new_pci_devices()
authorlinas@austin.ibm.com <linas@austin.ibm.com>
Fri, 13 Jan 2006 00:20:26 +0000 (18:20 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 1 Feb 2006 02:00:12 +0000 (18:00 -0800)
The function rpaphp_fixup_new_pci_devices() has been migrated to
pcibios_fixup_new_pci_devices() in
arch/powerpc/platforms/pseries/pci_dlpar.c
This patch removes the old version.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Acked-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/hotplug/rpadlpar_core.c
drivers/pci/hotplug/rpaphp.h
drivers/pci/hotplug/rpaphp_pci.c

index bc17a13fc82e060f095ce78a7a8a55bf9765c9e1..6c148106518efe47a9ed9fbf4e278c46ac2c5cd1 100644 (file)
@@ -146,7 +146,7 @@ static struct pci_dev *dlpar_pci_add_bus(struct device_node *dn)
            dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
                of_scan_pci_bridge(dn, dev);
 
-       rpaphp_init_new_devs(dev->subordinate);
+       pcibios_fixup_new_pci_devices(dev->subordinate,0);
 
        /* Claim new bus resources */
        pcibios_claim_one_bus(dev->bus);
index b333a35dd22138b859ef9062bb0582a7309f1310..6aa91ef5cd700996504d57972ee87157f3c8ee9f 100644 (file)
@@ -91,7 +91,6 @@ extern int num_slots;
 extern int rpaphp_enable_pci_slot(struct slot *slot);
 extern int register_pci_slot(struct slot *slot);
 extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);
-extern void rpaphp_init_new_devs(struct pci_bus *bus);
 
 extern int rpaphp_config_pci_adapter(struct pci_bus *bus);
 extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus);
index f16d0f9240ee70d11488c125f302c909edeb555e..1a12ebd10e34d99f6f3b011b7b0f14d9b71f7147 100644 (file)
@@ -101,140 +101,6 @@ exit:
        return rc;
 }
 
-/* Must be called before pci_bus_add_devices */
-void rpaphp_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus)
-{
-       struct pci_dev *dev;
-
-       list_for_each_entry(dev, &bus->devices, bus_list) {
-               /*
-                * Skip already-present devices (which are on the
-                * global device list.)
-                */
-               if (list_empty(&dev->global_list)) {
-                       int i;
-                       
-                       /* Need to setup IOMMU tables */
-                       ppc_md.iommu_dev_setup(dev);
-
-                       if(fix_bus)
-                               pcibios_fixup_device_resources(dev, bus);
-                       pci_read_irq_line(dev);
-                       for (i = 0; i < PCI_NUM_RESOURCES; i++) {
-                               struct resource *r = &dev->resource[i];
-
-                               if (r->parent || !r->start || !r->flags)
-                                       continue;
-                               pci_claim_resource(dev, i);
-                       }
-               }
-       }
-}
-
-static void rpaphp_eeh_add_bus_device(struct pci_bus *bus)
-{
-       struct pci_dev *dev;
-
-       list_for_each_entry(dev, &bus->devices, bus_list) {
-               eeh_add_device_late(dev);
-               if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
-                       struct pci_bus *subbus = dev->subordinate;
-                       if (subbus)
-                               rpaphp_eeh_add_bus_device (subbus);
-               }
-       }
-}
-
-static int rpaphp_pci_config_bridge(struct pci_dev *dev)
-{
-       u8 sec_busno;
-       struct pci_bus *child_bus;
-       struct pci_dev *child_dev;
-
-       dbg("Enter %s:  BRIDGE dev=%s\n", __FUNCTION__, pci_name(dev));
-
-       /* get busno of downstream bus */
-       pci_read_config_byte(dev, PCI_SECONDARY_BUS, &sec_busno);
-               
-       /* add to children of PCI bridge dev->bus */
-       child_bus = pci_add_new_bus(dev->bus, dev, sec_busno);
-       if (!child_bus) {
-               err("%s: could not add second bus\n", __FUNCTION__);
-               return -EIO;
-       }
-       sprintf(child_bus->name, "PCI Bus #%02x", child_bus->number);
-       /* do pci_scan_child_bus */
-       pci_scan_child_bus(child_bus);
-
-       list_for_each_entry(child_dev, &child_bus->devices, bus_list) {
-               eeh_add_device_late(child_dev);
-       }
-
-        /* fixup new pci devices without touching bus struct */
-       rpaphp_fixup_new_pci_devices(child_bus, 0);
-
-       /* Make the discovered devices available */
-       pci_bus_add_devices(child_bus);
-       return 0;
-}
-
-void rpaphp_init_new_devs(struct pci_bus *bus)
-{
-       rpaphp_fixup_new_pci_devices(bus, 0);
-       rpaphp_eeh_add_bus_device(bus);
-}
-EXPORT_SYMBOL_GPL(rpaphp_init_new_devs);
-
-/*****************************************************************************
- rpaphp_pci_config_slot() will  configure all devices under the
- given slot->dn and return the the first pci_dev.
- *****************************************************************************/
-static struct pci_dev *
-rpaphp_pci_config_slot(struct pci_bus *bus)
-{
-       struct device_node *dn = pci_bus_to_OF_node(bus);
-       struct pci_dev *dev = NULL;
-       int slotno;
-       int num;
-
-       dbg("Enter %s: dn=%s bus=%s\n", __FUNCTION__, dn->full_name, bus->name);
-       if (!dn || !dn->child)
-               return NULL;
-
-       if (_machine == PLATFORM_PSERIES_LPAR) {
-               of_scan_bus(dn, bus);
-               if (list_empty(&bus->devices)) {
-                       err("%s: No new device found\n", __FUNCTION__);
-                       return NULL;
-               }
-
-               rpaphp_init_new_devs(bus);
-               pci_bus_add_devices(bus);
-               dev = list_entry(&bus->devices, struct pci_dev, bus_list);
-       } else {
-               slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);
-
-               /* pci_scan_slot should find all children */
-               num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
-               if (num) {
-                       rpaphp_fixup_new_pci_devices(bus, 1);
-                       pci_bus_add_devices(bus);
-               }
-               if (list_empty(&bus->devices)) {
-                       err("%s: No new device found\n", __FUNCTION__);
-                       return NULL;
-               }
-               list_for_each_entry(dev, &bus->devices, bus_list) {
-                       if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)
-                               rpaphp_pci_config_bridge(dev);
-
-                       rpaphp_eeh_add_bus_device(bus);
-               }
-       }
-
-       return dev;
-}
-
 static void print_slot_pci_funcs(struct pci_bus *bus)
 {
        struct device_node *dn;
@@ -253,19 +119,13 @@ static void print_slot_pci_funcs(struct pci_bus *bus)
 int rpaphp_config_pci_adapter(struct pci_bus *bus)
 {
        struct device_node *dn = pci_bus_to_OF_node(bus);
-       struct pci_dev *dev;
        int rc = -ENODEV;
 
        dbg("Entry %s: slot[%s]\n", __FUNCTION__, dn->full_name);
        if (!dn)
                goto exit;
 
-       eeh_add_device_tree_early(dn);
-       dev = rpaphp_pci_config_slot(bus);
-       if (!dev) {
-               err("%s: can't find any devices.\n", __FUNCTION__);
-               goto exit;
-       }
+       pcibios_add_pci_devices(bus);
        print_slot_pci_funcs(bus);
        rc = 0;
 exit: