diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2017-01-31 16:36:32 -0600 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-01-31 16:36:32 -0600 |
commit | e5c3b3e9f012b8862753a04f03c6e27344332718 (patch) | |
tree | b1568a46d8a8ccda8098e4966873eee32b435e26 /drivers/pci/host | |
parent | 7ce7d89f48834cefece7804d38fc5d85382edf77 (diff) | |
download | op-kernel-dev-e5c3b3e9f012b8862753a04f03c6e27344332718.zip op-kernel-dev-e5c3b3e9f012b8862753a04f03c6e27344332718.tar.gz |
PCI: iproc: Use of_device_get_match_data() to simplify probe
The only way to call iproc_pcie_pltfm_probe() is to match an entry in
iproc_pcie_of_match_table[], so match cannot be NULL.
Use of_device_get_match_data() to retrieve the pcie->type. No functional
change intended.
Based-on-suggestion-from: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/host')
-rw-r--r-- | drivers/pci/host/pcie-iproc-platform.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/pci/host/pcie-iproc-platform.c b/drivers/pci/host/pcie-iproc-platform.c index 22d814a..f4909bb 100644 --- a/drivers/pci/host/pcie-iproc-platform.c +++ b/drivers/pci/host/pcie-iproc-platform.c @@ -47,7 +47,6 @@ MODULE_DEVICE_TABLE(of, iproc_pcie_of_match_table); static int iproc_pcie_pltfm_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - const struct of_device_id *of_id; struct iproc_pcie *pcie; struct device_node *np = dev->of_node; struct resource reg; @@ -55,16 +54,12 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev) LIST_HEAD(res); int ret; - of_id = of_match_device(iproc_pcie_of_match_table, dev); - if (!of_id) - return -EINVAL; - pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL); if (!pcie) return -ENOMEM; pcie->dev = dev; - pcie->type = (enum iproc_pcie_type)of_id->data; + pcie->type = (enum iproc_pcie_type) of_device_get_match_data(dev); ret = of_address_to_resource(np, 0, ®); if (ret < 0) { |