Skip to content

Commit 7073f2c

Browse files
firebolt007bjorn-helgaas
authored andcommitted
PCI: artpec6: Prefer of_device_get_match_data()
The artpec6 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-3-helgaas@kernel.org Signed-off-by: Fan Fei <ffclaire1224@gmail.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
1 parent c31990d commit 7073f2c

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/pci/controller/dwc/pcie-artpec6.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,17 +380,15 @@ static int artpec6_pcie_probe(struct platform_device *pdev)
380380
struct dw_pcie *pci;
381381
struct artpec6_pcie *artpec6_pcie;
382382
int ret;
383-
const struct of_device_id *match;
384383
const struct artpec_pcie_of_data *data;
385384
enum artpec_pcie_variants variant;
386385
enum dw_pcie_device_mode mode;
387386
u32 val;
388387

389-
match = of_match_device(artpec6_pcie_of_match, dev);
390-
if (!match)
388+
data = of_device_get_match_data(dev);
389+
if (!data)
391390
return -EINVAL;
392391

393-
data = (struct artpec_pcie_of_data *)match->data;
394392
variant = (enum artpec_pcie_variants)data->variant;
395393
mode = (enum dw_pcie_device_mode)data->mode;
396394

0 commit comments

Comments
 (0)