PCI: altera: Prefer of_device_get_match_data()
The altera 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-2-helgaas@kernel.org Signed-off-by: Fan Fei <ffclaire1224@gmail.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: Joyce Ooi <joyce.ooi@intel.com>
This commit is contained in:
parent
fa55b7dcdc
commit
c31990dbeb
@ -767,7 +767,7 @@ static int altera_pcie_probe(struct platform_device *pdev)
|
|||||||
struct altera_pcie *pcie;
|
struct altera_pcie *pcie;
|
||||||
struct pci_host_bridge *bridge;
|
struct pci_host_bridge *bridge;
|
||||||
int ret;
|
int ret;
|
||||||
const struct of_device_id *match;
|
const struct altera_pcie_data *data;
|
||||||
|
|
||||||
bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
|
bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
|
||||||
if (!bridge)
|
if (!bridge)
|
||||||
@ -777,11 +777,11 @@ static int altera_pcie_probe(struct platform_device *pdev)
|
|||||||
pcie->pdev = pdev;
|
pcie->pdev = pdev;
|
||||||
platform_set_drvdata(pdev, pcie);
|
platform_set_drvdata(pdev, pcie);
|
||||||
|
|
||||||
match = of_match_device(altera_pcie_of_match, &pdev->dev);
|
data = of_device_get_match_data(&pdev->dev);
|
||||||
if (!match)
|
if (!data)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
pcie->pcie_data = match->data;
|
pcie->pcie_data = data;
|
||||||
|
|
||||||
ret = altera_pcie_parse_dt(pcie);
|
ret = altera_pcie_parse_dt(pcie);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
Loading…
Reference in New Issue
Block a user