Commit 15480f3a authored by Marc Zyngier's avatar Marc Zyngier Committed by Bjorn Helgaas

PCI: layerscape: Fix drvdata usage before assignment

Commit fefe6733 ("PCI: layerscape: Move struct pcie_port setup
to probe function") changed the init ordering of the pcie structure,
but started to use the pcie->drvdata field before initializing it.
Mayhem follows.

Fix this by moving the drvdata assignment right before the first use.
Tested on LS2085a.

Fixes: efe6733e516 ("PCI: layerscape: Move struct pcie_port setup to probe function")
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent dabe7ecc
...@@ -247,6 +247,7 @@ static int __init ls_pcie_probe(struct platform_device *pdev) ...@@ -247,6 +247,7 @@ static int __init ls_pcie_probe(struct platform_device *pdev)
pp = &pcie->pp; pp = &pcie->pp;
pp->dev = dev; pp->dev = dev;
pcie->drvdata = match->data;
pp->ops = pcie->drvdata->ops; pp->ops = pcie->drvdata->ops;
dbi_base = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); dbi_base = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
...@@ -256,7 +257,6 @@ static int __init ls_pcie_probe(struct platform_device *pdev) ...@@ -256,7 +257,6 @@ static int __init ls_pcie_probe(struct platform_device *pdev)
return PTR_ERR(pcie->pp.dbi_base); return PTR_ERR(pcie->pp.dbi_base);
} }
pcie->drvdata = match->data;
pcie->lut = pcie->pp.dbi_base + pcie->drvdata->lut_offset; pcie->lut = pcie->pp.dbi_base + pcie->drvdata->lut_offset;
if (!ls_pcie_is_bridge(pcie)) if (!ls_pcie_is_bridge(pcie))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment