Skip to content

Commit 149fc35

Browse files
krzkbjorn-helgaas
authored andcommitted
PCI: layerscape: Use syscon_regmap_lookup_by_phandle_args
Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over syscon_regmap_lookup_by_phandle() combined with getting the syscon argument. Except simpler code this annotates within one line that given phandle has arguments, so grepping for code would be easier. Link: https://lore.kernel.org/r/20250112-syscon-phandle-args-pci-v1-2-fcb6ebcc0afc@linaro.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Acked-by: Roy Zang <Roy.Zang@nxp.com>
1 parent 40384c8 commit 149fc35

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/pci/controller/dwc/pci-layerscape.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@ static int ls_pcie_probe(struct platform_device *pdev)
329329
struct ls_pcie *pcie;
330330
struct resource *dbi_base;
331331
u32 index[2];
332-
int ret;
333332

334333
pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
335334
if (!pcie)
@@ -355,16 +354,15 @@ static int ls_pcie_probe(struct platform_device *pdev)
355354
pcie->pf_lut_base = pci->dbi_base + pcie->drvdata->pf_lut_off;
356355

357356
if (pcie->drvdata->scfg_support) {
358-
pcie->scfg = syscon_regmap_lookup_by_phandle(dev->of_node, "fsl,pcie-scfg");
357+
pcie->scfg =
358+
syscon_regmap_lookup_by_phandle_args(dev->of_node,
359+
"fsl,pcie-scfg", 2,
360+
index);
359361
if (IS_ERR(pcie->scfg)) {
360362
dev_err(dev, "No syscfg phandle specified\n");
361363
return PTR_ERR(pcie->scfg);
362364
}
363365

364-
ret = of_property_read_u32_array(dev->of_node, "fsl,pcie-scfg", index, 2);
365-
if (ret)
366-
return ret;
367-
368366
pcie->index = index[1];
369367
}
370368

0 commit comments

Comments
 (0)