mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-05 14:17:43 +00:00
PCI: mvebu: Use struct pci_host_bridge.windows list directly
There's no need to create a temporary resource list and then splice it to struct pci_host_bridge.windows list. Just use pci_host_bridge.windows directly. The necessary clean-up is already handled by the PCI core. Link: https://lore.kernel.org/r/20200522234832.954484-3-robh@kernel.org Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Jason Cooper <jason@lakedaemon.net>
This commit is contained in:
parent
24344226f6
commit
c322fa0b3f
1 changed files with 5 additions and 8 deletions
|
@ -71,7 +71,6 @@ struct mvebu_pcie {
|
|||
struct platform_device *pdev;
|
||||
struct mvebu_pcie_port *ports;
|
||||
struct msi_controller *msi;
|
||||
struct list_head resources;
|
||||
struct resource io;
|
||||
struct resource realio;
|
||||
struct resource mem;
|
||||
|
@ -961,17 +960,16 @@ static int mvebu_pcie_parse_request_resources(struct mvebu_pcie *pcie)
|
|||
{
|
||||
struct device *dev = &pcie->pdev->dev;
|
||||
struct device_node *np = dev->of_node;
|
||||
struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie);
|
||||
int ret;
|
||||
|
||||
INIT_LIST_HEAD(&pcie->resources);
|
||||
|
||||
/* Get the bus range */
|
||||
ret = of_pci_parse_bus_range(np, &pcie->busn);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to parse bus-range property: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
pci_add_resource(&pcie->resources, &pcie->busn);
|
||||
pci_add_resource(&bridge->windows, &pcie->busn);
|
||||
|
||||
/* Get the PCIe memory aperture */
|
||||
mvebu_mbus_get_pcie_mem_aperture(&pcie->mem);
|
||||
|
@ -981,7 +979,7 @@ static int mvebu_pcie_parse_request_resources(struct mvebu_pcie *pcie)
|
|||
}
|
||||
|
||||
pcie->mem.name = "PCI MEM";
|
||||
pci_add_resource(&pcie->resources, &pcie->mem);
|
||||
pci_add_resource(&bridge->windows, &pcie->mem);
|
||||
|
||||
/* Get the PCIe IO aperture */
|
||||
mvebu_mbus_get_pcie_io_aperture(&pcie->io);
|
||||
|
@ -994,10 +992,10 @@ static int mvebu_pcie_parse_request_resources(struct mvebu_pcie *pcie)
|
|||
resource_size(&pcie->io) - 1);
|
||||
pcie->realio.name = "PCI I/O";
|
||||
|
||||
pci_add_resource(&pcie->resources, &pcie->realio);
|
||||
pci_add_resource(&bridge->windows, &pcie->realio);
|
||||
}
|
||||
|
||||
return devm_request_pci_bus_resources(dev, &pcie->resources);
|
||||
return devm_request_pci_bus_resources(dev, &bridge->windows);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1118,7 +1116,6 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
|
|||
|
||||
pcie->nports = i;
|
||||
|
||||
list_splice_init(&pcie->resources, &bridge->windows);
|
||||
bridge->dev.parent = dev;
|
||||
bridge->sysdata = pcie;
|
||||
bridge->busnr = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue