Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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/20211223011054.1227810-4-helgaas@kernel.org
Signed-off-by: Fan Fei <ffclaire1224@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Tom Joseph <tjoseph@cadence.com>

authored by

Fan Fei and committed by
Bjorn Helgaas
131748ad 7073f2ce

+2 -4
+2 -4
drivers/pci/controller/cadence/pcie-cadence-plat.c
··· 45 45 { 46 46 const struct cdns_plat_pcie_of_data *data; 47 47 struct cdns_plat_pcie *cdns_plat_pcie; 48 - const struct of_device_id *match; 49 48 struct device *dev = &pdev->dev; 50 49 struct pci_host_bridge *bridge; 51 50 struct cdns_pcie_ep *ep; ··· 53 54 bool is_rc; 54 55 int ret; 55 56 56 - match = of_match_device(cdns_plat_pcie_of_match, dev); 57 - if (!match) 57 + data = of_device_get_match_data(dev); 58 + if (!data) 58 59 return -EINVAL; 59 60 60 - data = (struct cdns_plat_pcie_of_data *)match->data; 61 61 is_rc = data->is_rc; 62 62 63 63 pr_debug(" Started %s with is_rc: %d\n", __func__, is_rc);