Skip to content

Commit fed4ec7

Browse files
krzkmathieupoirier
authored andcommitted
remoteproc: keystone: 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]> Link: https://lore.kernel.org/r/20250111-b4-syscon-phandle-args-remoteproc-v1-4-73ed6fafa1e3@linaro.org Signed-off-by: Mathieu Poirier <[email protected]>
1 parent 266ce6e commit fed4ec7

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/remoteproc/keystone_remoteproc.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -341,17 +341,11 @@ static int keystone_rproc_of_get_dev_syscon(struct platform_device *pdev,
341341
return -EINVAL;
342342
}
343343

344-
ksproc->dev_ctrl =
345-
syscon_regmap_lookup_by_phandle(np, "ti,syscon-dev");
344+
ksproc->dev_ctrl = syscon_regmap_lookup_by_phandle_args(np, "ti,syscon-dev",
345+
1, &ksproc->boot_offset);
346346
if (IS_ERR(ksproc->dev_ctrl))
347347
return PTR_ERR(ksproc->dev_ctrl);
348348

349-
if (of_property_read_u32_index(np, "ti,syscon-dev", 1,
350-
&ksproc->boot_offset)) {
351-
dev_err(dev, "couldn't read the boot register offset\n");
352-
return -EINVAL;
353-
}
354-
355349
return 0;
356350
}
357351

0 commit comments

Comments
 (0)