powerpc/PCI: Use pci_is_bridge() to simplify code
authorYijing Wang <wangyijing@huawei.com>
Sun, 4 May 2014 04:23:41 +0000 (12:23 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 27 May 2014 20:57:36 +0000 (14:57 -0600)
Use pci_is_bridge() to simplify code.  No functional change.

Requires: 326c1cdae741 PCI: Rename pci_is_bridge() to pci_has_subordinate()
Requires: 1c86438c9423 PCI: Add new pci_is_bridge() interface
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
arch/powerpc/kernel/pci-hotplug.c
arch/powerpc/kernel/pci_of_scan.c

index c1e17ae68a08047a0a60154aed49684d8b4aad2f..5b789177aa29b65b35cf8ca3493e30511c0a74a5 100644 (file)
@@ -98,8 +98,7 @@ void pcibios_add_pci_devices(struct pci_bus * bus)
                max = bus->busn_res.start;
                for (pass = 0; pass < 2; pass++) {
                        list_for_each_entry(dev, &bus->devices, bus_list) {
-                               if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
-                                   dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
+                               if (pci_is_bridge(dev))
                                        max = pci_scan_bridge(bus, dev,
                                                              max, pass);
                        }
index 83c26d829991e8b8c118d6fa8d8d5bb7ffc68fda..059e244484fe95cc6cab46729d7771b052bb896a 100644 (file)
@@ -362,8 +362,7 @@ static void __of_scan_bus(struct device_node *node, struct pci_bus *bus,
 
        /* Now scan child busses */
        list_for_each_entry(dev, &bus->devices, bus_list) {
-               if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
-                   dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
+               if (pci_is_bridge(dev)) {
                        of_scan_pci_bridge(dev);
                }
        }