aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/pci_of_scan.c2
-rw-r--r--drivers/pci/probe.c4
-rw-r--r--include/linux/pci.h4
3 files changed, 8 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index 7311fdfb9bf8..693eb9a25bfa 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -140,6 +140,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
140 dev->devfn = devfn; 140 dev->devfn = devfn;
141 dev->multifunction = 0; /* maybe a lie? */ 141 dev->multifunction = 0; /* maybe a lie? */
142 dev->needs_freset = 0; /* pcie fundamental reset required */ 142 dev->needs_freset = 0; /* pcie fundamental reset required */
143 set_pcie_port_type(dev);
143 144
144 dev->vendor = get_int_prop(node, "vendor-id", 0xffff); 145 dev->vendor = get_int_prop(node, "vendor-id", 0xffff);
145 dev->device = get_int_prop(node, "device-id", 0xffff); 146 dev->device = get_int_prop(node, "device-id", 0xffff);
@@ -164,6 +165,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
164 /* a PCI-PCI bridge */ 165 /* a PCI-PCI bridge */
165 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE; 166 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;
166 dev->rom_base_reg = PCI_ROM_ADDRESS1; 167 dev->rom_base_reg = PCI_ROM_ADDRESS1;
168 set_pcie_hotplug_bridge(dev);
167 } else if (!strcmp(type, "cardbus")) { 169 } else if (!strcmp(type, "cardbus")) {
168 dev->hdr_type = PCI_HEADER_TYPE_CARDBUS; 170 dev->hdr_type = PCI_HEADER_TYPE_CARDBUS;
169 } else { 171 } else {
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 98ffb2de22e9..446e4a94d7d3 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -681,7 +681,7 @@ static void pci_read_irq(struct pci_dev *dev)
681 dev->irq = irq; 681 dev->irq = irq;
682} 682}
683 683
684static void set_pcie_port_type(struct pci_dev *pdev) 684void set_pcie_port_type(struct pci_dev *pdev)
685{ 685{
686 int pos; 686 int pos;
687 u16 reg16; 687 u16 reg16;
@@ -695,7 +695,7 @@ static void set_pcie_port_type(struct pci_dev *pdev)
695 pdev->pcie_type = (reg16 & PCI_EXP_FLAGS_TYPE) >> 4; 695 pdev->pcie_type = (reg16 & PCI_EXP_FLAGS_TYPE) >> 4;
696} 696}
697 697
698static void set_pcie_hotplug_bridge(struct pci_dev *pdev) 698void set_pcie_hotplug_bridge(struct pci_dev *pdev)
699{ 699{
700 int pos; 700 int pos;
701 u16 reg16; 701 u16 reg16;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 174e5392e51e..c1968f464c38 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -756,6 +756,10 @@ pci_power_t pci_target_state(struct pci_dev *dev);
756int pci_prepare_to_sleep(struct pci_dev *dev); 756int pci_prepare_to_sleep(struct pci_dev *dev);
757int pci_back_from_sleep(struct pci_dev *dev); 757int pci_back_from_sleep(struct pci_dev *dev);
758 758
759/* For use by arch with custom probe code */
760void set_pcie_port_type(struct pci_dev *pdev);
761void set_pcie_hotplug_bridge(struct pci_dev *pdev);
762
759/* Functions for PCI Hotplug drivers to use */ 763/* Functions for PCI Hotplug drivers to use */
760int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); 764int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);
761#ifdef CONFIG_HOTPLUG 765#ifdef CONFIG_HOTPLUG