Skip to content

Commit 6ab15b5

Browse files
robherringLorenzo Pieralisi
authored andcommitted
PCI: dwc: keystone: Convert .scan_bus() callback to use add_bus
TI keystone is the only Designware driver using .scan_bus(). This function pointer is the only thing preventing the Designware driver from using pci_host_probe(). Let's use the pci_ops.add_bus hook instead. Link: https://lore.kernel.org/r/20200821035420.380495-16-robh@kernel.org Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Murali Karicheri <m-karicheri2@ti.com> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Bjorn Helgaas <bhelgaas@google.com>
1 parent 6e8e104 commit 6ab15b5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/pci/controller/dwc/pci-keystone.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,15 +454,19 @@ static struct pci_ops ks_child_pcie_ops = {
454454
};
455455

456456
/**
457-
* ks_pcie_v3_65_scan_bus() - keystone scan_bus post initialization
457+
* ks_pcie_v3_65_add_bus() - keystone add_bus post initialization
458458
*
459459
* This sets BAR0 to enable inbound access for MSI_IRQ register
460460
*/
461-
static void ks_pcie_v3_65_scan_bus(struct pcie_port *pp)
461+
static int ks_pcie_v3_65_add_bus(struct pci_bus *bus)
462462
{
463+
struct pcie_port *pp = bus->sysdata;
463464
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
464465
struct keystone_pcie *ks_pcie = to_keystone_pcie(pci);
465466

467+
if (!pci_is_root_bus(bus))
468+
return 0;
469+
466470
/* Configure and set up BAR0 */
467471
ks_pcie_set_dbi_mode(ks_pcie);
468472

@@ -477,12 +481,15 @@ static void ks_pcie_v3_65_scan_bus(struct pcie_port *pp)
477481
* be sufficient. Use physical address to avoid any conflicts.
478482
*/
479483
dw_pcie_writel_dbi(pci, PCI_BASE_ADDRESS_0, ks_pcie->app.start);
484+
485+
return 0;
480486
}
481487

482488
static struct pci_ops ks_pcie_ops = {
483489
.map_bus = dw_pcie_own_conf_map_bus,
484490
.read = pci_generic_config_read,
485491
.write = pci_generic_config_write,
492+
.add_bus = ks_pcie_v3_65_add_bus,
486493
};
487494

488495
/**
@@ -842,7 +849,6 @@ static int __init ks_pcie_host_init(struct pcie_port *pp)
842849
static const struct dw_pcie_host_ops ks_pcie_host_ops = {
843850
.host_init = ks_pcie_host_init,
844851
.msi_host_init = ks_pcie_msi_host_init,
845-
.scan_bus = ks_pcie_v3_65_scan_bus,
846852
};
847853

848854
static const struct dw_pcie_host_ops ks_pcie_am654_host_ops = {

0 commit comments

Comments
 (0)