Skip to content

Commit dc078f1

Browse files
firebolt007bjorn-helgaas
authored andcommitted
PCI: dra7xx: Prefer of_device_get_match_data()
The dra7xx 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: Kishon Vijay Abraham I <[email protected]>
1 parent 5c20420 commit dc078f1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -697,16 +697,14 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)
697697
struct device_node *np = dev->of_node;
698698
char name[10];
699699
struct gpio_desc *reset;
700-
const struct of_device_id *match;
701700
const struct dra7xx_pcie_of_data *data;
702701
enum dw_pcie_device_mode mode;
703702
u32 b1co_mode_sel_mask;
704703

705-
match = of_match_device(of_match_ptr(of_dra7xx_pcie_match), dev);
706-
if (!match)
704+
data = of_device_get_match_data(dev);
705+
if (!data)
707706
return -EINVAL;
708707

709-
data = (struct dra7xx_pcie_of_data *)match->data;
710708
mode = (enum dw_pcie_device_mode)data->mode;
711709
b1co_mode_sel_mask = data->b1co_mode_sel_mask;
712710

0 commit comments

Comments
 (0)