Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Fan Fei and committed by
Bjorn Helgaas
7073f2ce c31990db

+2 -4
+2 -4
drivers/pci/controller/dwc/pcie-artpec6.c
··· 380 380 struct dw_pcie *pci; 381 381 struct artpec6_pcie *artpec6_pcie; 382 382 int ret; 383 - const struct of_device_id *match; 384 383 const struct artpec_pcie_of_data *data; 385 384 enum artpec_pcie_variants variant; 386 385 enum dw_pcie_device_mode mode; 387 386 u32 val; 388 387 389 - match = of_match_device(artpec6_pcie_of_match, dev); 390 - if (!match) 388 + data = of_device_get_match_data(dev); 389 + if (!data) 391 390 return -EINVAL; 392 391 393 - data = (struct artpec_pcie_of_data *)match->data; 394 392 variant = (enum artpec_pcie_variants)data->variant; 395 393 mode = (enum dw_pcie_device_mode)data->mode; 396 394