Skip to content
Snippets Groups Projects
Commit ea9b87c7 authored by Myron Stowe's avatar Myron Stowe
Browse files

PCI: layerscape: Fix arg_count to syscon_regmap_lookup_by_phandle_args()

JIRA: https://issues.redhat.com/browse/RHEL-83611
Upstream Status: 4c8c0ffd41d16cf08ccb0d3626beb54adfe5450a

commit 4c8c0ffd41d16cf08ccb0d3626beb54adfe5450a
Author: Ioana Ciornei <ioana.ciornei@nxp.com>
Date:   Thu Mar 27 17:19:49 2025 +0200

    PCI: layerscape: Fix arg_count to syscon_regmap_lookup_by_phandle_args()

    The arg_count parameter to syscon_regmap_lookup_by_phandle_args()
    represents the number of argument cells following the phandle. In this
    case, the number of arguments should be 1 instead of 2 since the dt
    property looks like this:

      fsl,pcie-scfg = <&scfg 0>;

    Without this fix, layerscape-pcie fails with the following message on
    LS1043A:

      OF: /soc/pcie@3500000: phandle scfg@1570000 needs 2, found 1
      layerscape-pcie 3500000.pcie: No syscfg phandle specified
      layerscape-pcie 3500000.pcie: probe with driver layerscape-pcie failed with error -22

    Link: https://lore.kernel.org/r/20250327151949.2765193-1-ioana.ciornei@nxp.com


    Fixes: 149fc35734e5 ("PCI: layerscape: Use syscon_regmap_lookup_by_phandle_args")
Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: default avatarRoy Zang <Roy.Zang@nxp.com>
    Cc: stable@vger.kernel.org

Signed-off-by: default avatarMyron Stowe <mstowe@redhat.com>
parent 81e730ac
No related branches found
No related tags found
No related merge requests found
......@@ -356,7 +356,7 @@ static int ls_pcie_probe(struct platform_device *pdev)
if (pcie->drvdata->scfg_support) {
pcie->scfg =
syscon_regmap_lookup_by_phandle_args(dev->of_node,
"fsl,pcie-scfg", 2,
"fsl,pcie-scfg", 1,
index);
if (IS_ERR(pcie->scfg)) {
dev_err(dev, "No syscfg phandle specified\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment