Skip to content

Commit 39a29fb

Browse files
firebolt007bjorn-helgaas
authored andcommitted
PCI: keystone: Prefer of_device_get_match_data()
The keystone 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-7-helgaas@kernel.org Signed-off-by: Fan Fei <ffclaire1224@gmail.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: Kishon Vijay Abraham I <kishon@ti.com>
1 parent dc078f1 commit 39a29fb

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/pci/controller/dwc/pci-keystone.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,6 @@ static int __init ks_pcie_probe(struct platform_device *pdev)
10871087
struct device *dev = &pdev->dev;
10881088
struct device_node *np = dev->of_node;
10891089
const struct ks_pcie_of_data *data;
1090-
const struct of_device_id *match;
10911090
enum dw_pcie_device_mode mode;
10921091
struct dw_pcie *pci;
10931092
struct keystone_pcie *ks_pcie;
@@ -1104,8 +1103,7 @@ static int __init ks_pcie_probe(struct platform_device *pdev)
11041103
int irq;
11051104
int i;
11061105

1107-
match = of_match_device(of_match_ptr(ks_pcie_of_match), dev);
1108-
data = (struct ks_pcie_of_data *)match->data;
1106+
data = of_device_get_match_data(dev);
11091107
if (!data)
11101108
return -EINVAL;
11111109

0 commit comments

Comments
 (0)