Skip to content

Commit 5c20420

Browse files
firebolt007bjorn-helgaas
authored andcommitted
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]>
1 parent 131748a commit 5c20420

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pci/controller/dwc/pcie-designware-plat.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,13 @@ static int dw_plat_pcie_probe(struct platform_device *pdev)
122122
struct dw_plat_pcie *dw_plat_pcie;
123123
struct dw_pcie *pci;
124124
int ret;
125-
const struct of_device_id *match;
126125
const struct dw_plat_pcie_of_data *data;
127126
enum dw_pcie_device_mode mode;
128127

129-
match = of_match_device(dw_plat_pcie_of_match, dev);
130-
if (!match)
128+
data = of_device_get_match_data(dev);
129+
if (!data)
131130
return -EINVAL;
132131

133-
data = (struct dw_plat_pcie_of_data *)match->data;
134132
mode = (enum dw_pcie_device_mode)data->mode;
135133

136134
dw_plat_pcie = devm_kzalloc(dev, sizeof(*dw_plat_pcie), GFP_KERNEL);

0 commit comments

Comments
 (0)