]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
PCI: designware-plat: Prefer of_device_get_match_data()
authorFan Fei <ffclaire1224@gmail.com>
Thu, 23 Dec 2021 01:10:35 +0000 (19:10 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 3 Jan 2022 21:01:09 +0000 (15:01 -0600)
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/20211223011054.1227810-5-helgaas@kernel.org
Signed-off-by: Fan Fei <ffclaire1224@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
drivers/pci/controller/dwc/pcie-designware-plat.c

index 8851eb161a0ebd25ec2249836d385430a307e727..0c5de87d3cc630f2625140f2eb24f3ad01a372e8 100644 (file)
@@ -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);