Skip to content

Commit

Permalink
PCI: tegra: Use of_device_get_match_data()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thierry Reding authored and Bjorn Helgaas committed Aug 18, 2016
1 parent a7fbae2 commit c460af9
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/pci/host/pci-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -2201,21 +2201,16 @@ static int tegra_pcie_debugfs_init(struct tegra_pcie *pcie)

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);
Expand Down

0 comments on commit c460af9

Please sign in to comment.