Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7c9d4cf authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/resource'

  - add managed interface to get PCI host bridge resources from OF (Jan
    Kiszka)

  - add support for unbinding generic PCI host controller (Jan Kiszka)

  - fix memory leaks when unbinding generic PCI host controller (Jan Kiszka)

* pci/resource:
  PCI: Enable PCI_DOMAINS along with generic PCI host controller
  PCI: Add support for unbinding the generic PCI host controller
  PCI: Rework of_pci_get_host_bridge_resources() to devm_of_pci_get_host_bridge_resources()
  PCI: Use dev_printk() in of_pci_get_host_bridge_resources()
  PCI: Pass struct device to of_pci_get_host_bridge_resources()
  PCI: Rename of_pci_get_host_bridge_resources() device node parameter
  PCI: Fix devm_pci_alloc_host_bridge() memory leak
  PCI: Make pci_get_new_domain_nr() static
parents ae08aa13 37bd62d2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ int dw_pcie_host_init(struct pcie_port *pp)
	if (!bridge)
		return -ENOMEM;

	ret = of_pci_get_host_bridge_resources(np, 0, 0xff,
	ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff,
					&bridge->windows, &pp->io_base);
	if (ret)
		return ret;
+1 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ config PCI_HOST_GENERIC
	depends on (ARM || ARM64) && OF
	select PCI_HOST_COMMON
	select IRQ_DOMAIN
	select PCI_DOMAINS
	help
	  Say Y here if you want to support a simple generic PCI host
	  controller, such as the one emulated by kvmtool.
+2 −3
Original line number Diff line number Diff line
@@ -815,14 +815,13 @@ static int advk_pcie_parse_request_of_pci_ranges(struct advk_pcie *pcie)
{
	int err, res_valid = 0;
	struct device *dev = &pcie->pdev->dev;
	struct device_node *np = dev->of_node;
	struct resource_entry *win, *tmp;
	resource_size_t iobase;

	INIT_LIST_HEAD(&pcie->resources);

	err = of_pci_get_host_bridge_resources(np, 0, 0xff, &pcie->resources,
					       &iobase);
	err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff,
						    &pcie->resources, &iobase);
	if (err)
		return err;

+2 −2
Original line number Diff line number Diff line
@@ -476,7 +476,7 @@ static int faraday_pci_probe(struct platform_device *pdev)
	if (IS_ERR(p->base))
		return PTR_ERR(p->base);

	ret = of_pci_get_host_bridge_resources(dev->of_node, 0, 0xff,
	ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff,
						    &res, &io_base);
	if (ret)
		return ret;
+13 −0
Original line number Diff line number Diff line
@@ -101,5 +101,18 @@ int pci_host_common_probe(struct platform_device *pdev,
		return ret;
	}

	platform_set_drvdata(pdev, bridge->bus);
	return 0;
}

int pci_host_common_remove(struct platform_device *pdev)
{
	struct pci_bus *bus = platform_get_drvdata(pdev);

	pci_lock_rescan_remove();
	pci_stop_root_bus(bus);
	pci_remove_root_bus(bus);
	pci_unlock_rescan_remove();

	return 0;
}
Loading