diff options
author | Manikanta Maddireddy <mmaddireddy@nvidia.com> | 2018-01-11 01:08:03 -0500 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2018-01-15 11:46:04 -0500 |
commit | 78243ff0a4ec42c1523dc3511b29c5e87936d911 (patch) | |
tree | 77feaf632ae37eb80ac638c8e2f6c092ad864af8 | |
parent | bf6681ea53353864bf23a24c82a5c7ac4d7a4e19 (diff) |
PCI: tegra: Use bus->sysdata to store and get host private data
Tegra host driver is using pci_find_host_bridge() to get private data;
this can be easily avoided by using bus->sysdata to store and get private
data removing the pci_find_host_bridge() dependency.
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
[lorenzo.pieralisi@arm.com: rewrote commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Thierry Reding <treding@nvidia.com>
-rw-r--r-- | drivers/pci/host/pci-tegra.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c index 4c105fbda777..059aa73d5f76 100644 --- a/drivers/pci/host/pci-tegra.c +++ b/drivers/pci/host/pci-tegra.c | |||
@@ -379,8 +379,7 @@ static void __iomem *tegra_pcie_map_bus(struct pci_bus *bus, | |||
379 | unsigned int devfn, | 379 | unsigned int devfn, |
380 | int where) | 380 | int where) |
381 | { | 381 | { |
382 | struct pci_host_bridge *host = pci_find_host_bridge(bus); | 382 | struct tegra_pcie *pcie = bus->sysdata; |
383 | struct tegra_pcie *pcie = pci_host_bridge_priv(host); | ||
384 | void __iomem *addr = NULL; | 383 | void __iomem *addr = NULL; |
385 | 384 | ||
386 | if (bus->number == 0) { | 385 | if (bus->number == 0) { |
@@ -573,8 +572,7 @@ static int tegra_pcie_request_resources(struct tegra_pcie *pcie) | |||
573 | 572 | ||
574 | static int tegra_pcie_map_irq(const struct pci_dev *pdev, u8 slot, u8 pin) | 573 | static int tegra_pcie_map_irq(const struct pci_dev *pdev, u8 slot, u8 pin) |
575 | { | 574 | { |
576 | struct pci_host_bridge *host = pci_find_host_bridge(pdev->bus); | 575 | struct tegra_pcie *pcie = pdev->bus->sysdata; |
577 | struct tegra_pcie *pcie = pci_host_bridge_priv(host); | ||
578 | int irq; | 576 | int irq; |
579 | 577 | ||
580 | tegra_cpuidle_pcie_irqs_in_use(); | 578 | tegra_cpuidle_pcie_irqs_in_use(); |
@@ -2258,6 +2256,7 @@ static int tegra_pcie_probe(struct platform_device *pdev) | |||
2258 | return -ENOMEM; | 2256 | return -ENOMEM; |
2259 | 2257 | ||
2260 | pcie = pci_host_bridge_priv(host); | 2258 | pcie = pci_host_bridge_priv(host); |
2259 | host->sysdata = pcie; | ||
2261 | 2260 | ||
2262 | pcie->soc = of_device_get_match_data(dev); | 2261 | pcie->soc = of_device_get_match_data(dev); |
2263 | INIT_LIST_HEAD(&pcie->ports); | 2262 | INIT_LIST_HEAD(&pcie->ports); |