aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFan Fei <[email protected]>2021-12-22 19:10:35 -0600
committerBjorn Helgaas <[email protected]>2022-01-03 15:01:09 -0600
commit5c204204cf243136804b3a9da77d091e3f803668 (patch)
tree4c3ea0ff23ef743ccd372a6972200155a30bbf68
parent131748ad2939dfaf20b3178112dbd52591d39148 (diff)
PCI: designware-plat: Prefer of_device_get_match_data()
The designware-plat 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: Jingoo Han <[email protected]> Cc: Gustavo Pimentel <[email protected]>
-rw-r--r--drivers/pci/controller/dwc/pcie-designware-plat.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/pci/controller/dwc/pcie-designware-plat.c b/drivers/pci/controller/dwc/pcie-designware-plat.c
index 8851eb161a0e..0c5de87d3cc6 100644
--- a/drivers/pci/controller/dwc/pcie-designware-plat.c
+++ b/drivers/pci/controller/dwc/pcie-designware-plat.c
@@ -122,15 +122,13 @@ static int dw_plat_pcie_probe(struct platform_device *pdev)
struct dw_plat_pcie *dw_plat_pcie;
struct dw_pcie *pci;
int ret;
- const struct of_device_id *match;
const struct dw_plat_pcie_of_data *data;
enum dw_pcie_device_mode mode;
- match = of_match_device(dw_plat_pcie_of_match, dev);
- if (!match)
+ data = of_device_get_match_data(dev);
+ if (!data)
return -EINVAL;
- data = (struct dw_plat_pcie_of_data *)match->data;
mode = (enum dw_pcie_device_mode)data->mode;
dw_plat_pcie = devm_kzalloc(dev, sizeof(*dw_plat_pcie), GFP_KERNEL);