Skip to content

Commit 6a58990

Browse files
robherringLorenzo Pieralisi
authored andcommitted
PCI: Set default bridge parent device
The host bridge's parent device is always the platform device. As we already have a pointer to it in the devres functions, let's initialize the parent device. Drivers can still override the parent if desired. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Cc: Bjorn Helgaas <[email protected]>
1 parent 79cbde5 commit 6a58990

21 files changed

+2
-21
lines changed

drivers/pci/controller/cadence/pcie-cadence-host.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc)
241241
if (ret)
242242
goto err_init;
243243

244-
bridge->dev.parent = dev;
245244
bridge->busnr = pcie->bus;
246245
bridge->ops = &cdns_pcie_host_ops;
247246
bridge->map_irq = of_irq_parse_and_map_pci;

drivers/pci/controller/dwc/pcie-designware-host.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,6 @@ int dw_pcie_host_init(struct pcie_port *pp)
475475

476476
pp->root_bus_nr = pp->busn->start;
477477

478-
bridge->dev.parent = dev;
479478
bridge->sysdata = pp;
480479
bridge->busnr = pp->root_bus_nr;
481480
bridge->ops = &dw_pcie_ops;

drivers/pci/controller/mobiveil/pcie-mobiveil-host.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,6 @@ int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie)
605605
}
606606

607607
/* Initialize bridge */
608-
bridge->dev.parent = dev;
609608
bridge->sysdata = pcie;
610609
bridge->busnr = rp->root_bus_nr;
611610
bridge->ops = &mobiveil_pcie_ops;

drivers/pci/controller/pci-aardvark.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,6 @@ static int advk_pcie_probe(struct platform_device *pdev)
11831183
return ret;
11841184
}
11851185

1186-
bridge->dev.parent = dev;
11871186
bridge->sysdata = pcie;
11881187
bridge->busnr = 0;
11891188
bridge->ops = &advk_pcie_ops;

drivers/pci/controller/pci-ftpci100.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ static int faraday_pci_probe(struct platform_device *pdev)
436436
if (!host)
437437
return -ENOMEM;
438438

439-
host->dev.parent = dev;
440439
host->ops = &faraday_pci_ops;
441440
host->busnr = 0;
442441
host->msi = NULL;

drivers/pci/controller/pci-host-common.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ int pci_host_common_probe(struct platform_device *pdev)
7676
if (!pci_has_flag(PCI_PROBE_ONLY))
7777
pci_add_flags(PCI_REASSIGN_ALL_BUS);
7878

79-
bridge->dev.parent = dev;
8079
bridge->sysdata = cfg;
8180
bridge->busnr = cfg->busr.start;
8281
bridge->ops = (struct pci_ops *)&ops->pci_ops;

drivers/pci/controller/pci-loongson.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ static int loongson_pci_probe(struct platform_device *pdev)
225225
return err;
226226
}
227227

228-
bridge->dev.parent = dev;
229228
bridge->sysdata = priv;
230229
bridge->ops = &loongson_pci_ops;
231230
bridge->map_irq = loongson_map_irq;

drivers/pci/controller/pci-mvebu.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,6 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
11161116

11171117
pcie->nports = i;
11181118

1119-
bridge->dev.parent = dev;
11201119
bridge->sysdata = pcie;
11211120
bridge->busnr = 0;
11221121
bridge->ops = &mvebu_pcie_ops;

drivers/pci/controller/pci-tegra.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2713,7 +2713,6 @@ static int tegra_pcie_probe(struct platform_device *pdev)
27132713
}
27142714

27152715
host->busnr = bus->start;
2716-
host->dev.parent = &pdev->dev;
27172716
host->ops = &tegra_pcie_ops;
27182717
host->map_irq = tegra_pcie_map_irq;
27192718
host->swizzle_irq = pci_common_swizzle;

drivers/pci/controller/pci-v3-semi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,6 @@ static int v3_pci_probe(struct platform_device *pdev)
723723
if (!host)
724724
return -ENOMEM;
725725

726-
host->dev.parent = dev;
727726
host->ops = &v3_pci_ops;
728727
host->busnr = 0;
729728
host->msi = NULL;

0 commit comments

Comments
 (0)