summaryrefslogtreecommitdiffstats
path: root/drivers/pci/host/pci-tegra.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2016-08-15 17:31:32 +0200
committerBjorn Helgaas <bhelgaas@google.com>2016-08-18 15:41:41 -0500
commitc460af94c3bedefc4218e07629d0ba06fd5ac80b (patch)
tree196e37c12d76ca763db65682ffe1a0d9e0304d37 /drivers/pci/host/pci-tegra.c
parenta7fbae213925488066e296f30cc81aaa2c5c2802 (diff)
PCI: tegra: Use of_device_get_match_data()
of_device_get_match_data() was added in v4.2 to reduce the the boilerplate required to get at SoC-specific data. Use it to simplify the code slightly. [bhelgaas: changelog] Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/host/pci-tegra.c')
-rw-r--r--drivers/pci/host/pci-tegra.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 7756a792600c..2d520755b1d7 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -2201,21 +2201,16 @@ remove:
static int tegra_pcie_probe(struct platform_device *pdev)
{
- const struct of_device_id *match;
struct tegra_pcie *pcie;
int err;
- match = of_match_device(tegra_pcie_of_match, &pdev->dev);
- if (!match)
- return -ENODEV;
-
pcie = devm_kzalloc(&pdev->dev, sizeof(*pcie), GFP_KERNEL);
if (!pcie)
return -ENOMEM;
+ pcie->soc = of_device_get_match_data(&pdev->dev);
INIT_LIST_HEAD(&pcie->buses);
INIT_LIST_HEAD(&pcie->ports);
- pcie->soc = match->data;
pcie->dev = &pdev->dev;
err = tegra_pcie_parse_dt(pcie);