aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/controller/pcie-altera.c
diff options
context:
space:
mode:
authorFan Fei <[email protected]>2021-12-23 01:10:32 +0000
committerBjorn Helgaas <[email protected]>2022-01-03 21:00:47 +0000
commitc31990dbeb78e435b541c27f6611134037f1f0ac (patch)
treede2098ec5b68fb78fb1a5bb36f44102ed24fe00b /drivers/pci/controller/pcie-altera.c
parentLinux 5.16-rc1 (diff)
downloadkernel-c31990dbeb78e435b541c27f6611134037f1f0ac.tar.gz
kernel-c31990dbeb78e435b541c27f6611134037f1f0ac.zip
PCI: altera: Prefer of_device_get_match_data()
The altera driver only needs the device data, not the whole struct of_device_id. Use of_device_get_match_data() instead of of_match_device(). No functional change intended. [bhelgaas: commit log] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Fan Fei <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Cc: Joyce Ooi <[email protected]>
Diffstat (limited to 'drivers/pci/controller/pcie-altera.c')
-rw-r--r--drivers/pci/controller/pcie-altera.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c
index 2513e9363236..98ada2e20e02 100644
--- a/drivers/pci/controller/pcie-altera.c
+++ b/drivers/pci/controller/pcie-altera.c
@@ -767,7 +767,7 @@ static int altera_pcie_probe(struct platform_device *pdev)
struct altera_pcie *pcie;
struct pci_host_bridge *bridge;
int ret;
- const struct of_device_id *match;
+ const struct altera_pcie_data *data;
bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
if (!bridge)
@@ -777,11 +777,11 @@ static int altera_pcie_probe(struct platform_device *pdev)
pcie->pdev = pdev;
platform_set_drvdata(pdev, pcie);
- match = of_match_device(altera_pcie_of_match, &pdev->dev);
- if (!match)
+ data = of_device_get_match_data(&pdev->dev);
+ if (!data)
return -ENODEV;
- pcie->pcie_data = match->data;
+ pcie->pcie_data = data;
ret = altera_pcie_parse_dt(pcie);
if (ret) {