Skip to content

Commit

Permalink
remoteproc: st: Use syscon_regmap_lookup_by_phandle_args
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
krzk authored and mathieupoirier committed Jan 15, 2025
1 parent fed4ec7 commit 3a53ff9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/remoteproc/st_remoteproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,18 +314,12 @@ static int st_rproc_parse_dt(struct platform_device *pdev)
return err;
}

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

err = of_property_read_u32_index(np, "st,syscfg", 1,
&ddata->boot_offset);
if (err) {
dev_err(dev, "Boot offset not found\n");
return -EINVAL;
}

err = clk_prepare(ddata->clk);
if (err)
dev_err(dev, "failed to get clock\n");
Expand Down

0 comments on commit 3a53ff9

Please sign in to comment.