From: Patrice CHOTARD <patrice.chotard@foss.st.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Bjorn Andersson <andersson@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: <linux-remoteproc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 5/5] remoteproc: st: Use syscon_regmap_lookup_by_phandle_args
Date: Mon, 13 Jan 2025 09:25:07 +0100 [thread overview]
Message-ID: <06b8e94f-0724-4a8e-bdcd-83e08faa7673@foss.st.com> (raw)
In-Reply-To: <20250111-b4-syscon-phandle-args-remoteproc-v1-5-73ed6fafa1e3@linaro.org>
On 1/11/25 19:42, Krzysztof Kozlowski wrote:
> 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 <krzysztof.kozlowski@linaro.org>
> ---
> drivers/remoteproc/st_remoteproc.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c
> index d1f35e8a83ba525613ed4e54d2269b7e9f427e46..e6566a9839dc5ffc83d907a3076fc4b0a644138a 100644
> --- a/drivers/remoteproc/st_remoteproc.c
> +++ b/drivers/remoteproc/st_remoteproc.c
> @@ -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");
>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Thanks
Patrice
next prev parent reply other threads:[~2025-01-13 8:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-11 18:42 [PATCH 0/5] remoteproc: Simplify few things: omap, keystone, st Krzysztof Kozlowski
2025-01-11 18:42 ` [PATCH 1/5] remoteproc: keystone: Simplify returning syscon PTR_ERR Krzysztof Kozlowski
2025-01-11 18:42 ` [PATCH 2/5] remoteproc: omap: " Krzysztof Kozlowski
2025-01-11 18:42 ` [PATCH 3/5] remoteproc: st: Simplify with dev_err_probe Krzysztof Kozlowski
2025-01-13 8:23 ` Patrice CHOTARD
2025-01-11 18:42 ` [PATCH 4/5] remoteproc: keystone: Use syscon_regmap_lookup_by_phandle_args Krzysztof Kozlowski
2025-01-11 18:42 ` [PATCH 5/5] remoteproc: st: " Krzysztof Kozlowski
2025-01-13 8:25 ` Patrice CHOTARD [this message]
2025-01-15 17:07 ` [PATCH 0/5] remoteproc: Simplify few things: omap, keystone, st Mathieu Poirier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=06b8e94f-0724-4a8e-bdcd-83e08faa7673@foss.st.com \
--to=patrice.chotard@foss.st.com \
--cc=andersson@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.