Skip to content

Commit c31990d

Browse files
firebolt007bjorn-helgaas
authored andcommitted
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/20211223011054.1227810-2-helgaas@kernel.org Signed-off-by: Fan Fei <ffclaire1224@gmail.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: Joyce Ooi <joyce.ooi@intel.com>
1 parent fa55b7d commit c31990d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/pci/controller/pcie-altera.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ static int altera_pcie_probe(struct platform_device *pdev)
767767
struct altera_pcie *pcie;
768768
struct pci_host_bridge *bridge;
769769
int ret;
770-
const struct of_device_id *match;
770+
const struct altera_pcie_data *data;
771771

772772
bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
773773
if (!bridge)
@@ -777,11 +777,11 @@ static int altera_pcie_probe(struct platform_device *pdev)
777777
pcie->pdev = pdev;
778778
platform_set_drvdata(pdev, pcie);
779779

780-
match = of_match_device(altera_pcie_of_match, &pdev->dev);
781-
if (!match)
780+
data = of_device_get_match_data(&pdev->dev);
781+
if (!data)
782782
return -ENODEV;
783783

784-
pcie->pcie_data = match->data;
784+
pcie->pcie_data = data;
785785

786786
ret = altera_pcie_parse_dt(pcie);
787787
if (ret) {

0 commit comments

Comments
 (0)