Skip to content

Commit 131748a

Browse files
firebolt007bjorn-helgaas
authored andcommitted
PCI: cadence: Prefer of_device_get_match_data()
The cadence 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: Tom Joseph <[email protected]>
1 parent 7073f2c commit 131748a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pci/controller/cadence/pcie-cadence-plat.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ static int cdns_plat_pcie_probe(struct platform_device *pdev)
4545
{
4646
const struct cdns_plat_pcie_of_data *data;
4747
struct cdns_plat_pcie *cdns_plat_pcie;
48-
const struct of_device_id *match;
4948
struct device *dev = &pdev->dev;
5049
struct pci_host_bridge *bridge;
5150
struct cdns_pcie_ep *ep;
@@ -54,11 +53,10 @@ static int cdns_plat_pcie_probe(struct platform_device *pdev)
5453
bool is_rc;
5554
int ret;
5655

57-
match = of_match_device(cdns_plat_pcie_of_match, dev);
58-
if (!match)
56+
data = of_device_get_match_data(dev);
57+
if (!data)
5958
return -EINVAL;
6059

61-
data = (struct cdns_plat_pcie_of_data *)match->data;
6260
is_rc = data->is_rc;
6361

6462
pr_debug(" Started %s with is_rc: %d\n", __func__, is_rc);

0 commit comments

Comments
 (0)