Skip to content

Commit 3a53ff9

Browse files
krzkmathieupoirier
authored andcommitted
remoteproc: st: Use syscon_regmap_lookup_by_phandle_args
Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over syscon_regmap_lookup_by_phandle() and getting the argument. Except simpler code this annotates within one line that given phandle has arguments, so grepping for code would be easier. There is also no real benefit in printing errors on missing syscon argument, because this is done just too late: runtime check on static/build-time data. Dtschema and Devicetree bindings offer the static/build-time check for this already. Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Patrice Chotard <[email protected]> Link: https://lore.kernel.org/r/20250111-b4-syscon-phandle-args-remoteproc-v1-5-73ed6fafa1e3@linaro.org Signed-off-by: Mathieu Poirier <[email protected]>
1 parent fed4ec7 commit 3a53ff9

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/remoteproc/st_remoteproc.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -314,18 +314,12 @@ static int st_rproc_parse_dt(struct platform_device *pdev)
314314
return err;
315315
}
316316

317-
ddata->boot_base = syscon_regmap_lookup_by_phandle(np, "st,syscfg");
317+
ddata->boot_base = syscon_regmap_lookup_by_phandle_args(np, "st,syscfg",
318+
1, &ddata->boot_offset);
318319
if (IS_ERR(ddata->boot_base))
319320
return dev_err_probe(dev, PTR_ERR(ddata->boot_base),
320321
"Boot base not found\n");
321322

322-
err = of_property_read_u32_index(np, "st,syscfg", 1,
323-
&ddata->boot_offset);
324-
if (err) {
325-
dev_err(dev, "Boot offset not found\n");
326-
return -EINVAL;
327-
}
328-
329323
err = clk_prepare(ddata->clk);
330324
if (err)
331325
dev_err(dev, "failed to get clock\n");

0 commit comments

Comments
 (0)