* [PATCH 1/5] remoteproc: keystone: Simplify returning syscon PTR_ERR
2025-01-11 18:42 [PATCH 0/5] remoteproc: Simplify few things: omap, keystone, st Krzysztof Kozlowski
@ 2025-01-11 18:42 ` Krzysztof Kozlowski
2025-01-11 18:42 ` [PATCH 2/5] remoteproc: omap: " Krzysztof Kozlowski
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-11 18:42 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Patrice Chotard
Cc: linux-remoteproc, linux-kernel, linux-arm-kernel,
Krzysztof Kozlowski
No need to store PTR_ERR into temporary, local 'ret' variable.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/remoteproc/keystone_remoteproc.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/remoteproc/keystone_remoteproc.c b/drivers/remoteproc/keystone_remoteproc.c
index 6e54093d1732314d234e85bf6cf7fb6f1d9bf994..83c8e568f7ce3ec3ca3a534d2566f6437e9d403a 100644
--- a/drivers/remoteproc/keystone_remoteproc.c
+++ b/drivers/remoteproc/keystone_remoteproc.c
@@ -335,7 +335,6 @@ static int keystone_rproc_of_get_dev_syscon(struct platform_device *pdev,
{
struct device_node *np = pdev->dev.of_node;
struct device *dev = &pdev->dev;
- int ret;
if (!of_property_read_bool(np, "ti,syscon-dev")) {
dev_err(dev, "ti,syscon-dev property is absent\n");
@@ -344,10 +343,8 @@ static int keystone_rproc_of_get_dev_syscon(struct platform_device *pdev,
ksproc->dev_ctrl =
syscon_regmap_lookup_by_phandle(np, "ti,syscon-dev");
- if (IS_ERR(ksproc->dev_ctrl)) {
- ret = PTR_ERR(ksproc->dev_ctrl);
- return ret;
- }
+ if (IS_ERR(ksproc->dev_ctrl))
+ return PTR_ERR(ksproc->dev_ctrl);
if (of_property_read_u32_index(np, "ti,syscon-dev", 1,
&ksproc->boot_offset)) {
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 2/5] remoteproc: omap: Simplify returning syscon PTR_ERR
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 ` Krzysztof Kozlowski
2025-01-11 18:42 ` [PATCH 3/5] remoteproc: st: Simplify with dev_err_probe Krzysztof Kozlowski
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-11 18:42 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Patrice Chotard
Cc: linux-remoteproc, linux-kernel, linux-arm-kernel,
Krzysztof Kozlowski
No need to store PTR_ERR into temporary, local 'ret' variable.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/remoteproc/omap_remoteproc.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c
index 3260dd512491e8920fc881b6a7c0d9b6f725e7f5..5f463937cbbff2c9ed5b22bed42454a0ae290f0f 100644
--- a/drivers/remoteproc/omap_remoteproc.c
+++ b/drivers/remoteproc/omap_remoteproc.c
@@ -1137,7 +1137,6 @@ static int omap_rproc_get_boot_data(struct platform_device *pdev,
struct device_node *np = pdev->dev.of_node;
struct omap_rproc *oproc = rproc->priv;
const struct omap_rproc_dev_data *data;
- int ret;
data = of_device_get_match_data(&pdev->dev);
if (!data)
@@ -1153,10 +1152,8 @@ static int omap_rproc_get_boot_data(struct platform_device *pdev,
oproc->boot_data->syscon =
syscon_regmap_lookup_by_phandle(np, "ti,bootreg");
- if (IS_ERR(oproc->boot_data->syscon)) {
- ret = PTR_ERR(oproc->boot_data->syscon);
- return ret;
- }
+ if (IS_ERR(oproc->boot_data->syscon))
+ return PTR_ERR(oproc->boot_data->syscon);
if (of_property_read_u32_index(np, "ti,bootreg", 1,
&oproc->boot_data->boot_reg)) {
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 3/5] remoteproc: st: Simplify with dev_err_probe
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 ` 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
` (2 subsequent siblings)
5 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-11 18:42 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Patrice Chotard
Cc: linux-remoteproc, linux-kernel, linux-arm-kernel,
Krzysztof Kozlowski
Use dev_err_probe() to make error code handling simpler and handle
deferred probe.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/remoteproc/st_remoteproc.c | 44 +++++++++++++++++---------------------
1 file changed, 20 insertions(+), 24 deletions(-)
diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c
index 5df99bae7131a832c0c03c9bf8619812d9eb570d..d1f35e8a83ba525613ed4e54d2269b7e9f427e46 100644
--- a/drivers/remoteproc/st_remoteproc.c
+++ b/drivers/remoteproc/st_remoteproc.c
@@ -290,26 +290,23 @@ static int st_rproc_parse_dt(struct platform_device *pdev)
if (ddata->config->sw_reset) {
ddata->sw_reset = devm_reset_control_get_exclusive(dev,
"sw_reset");
- if (IS_ERR(ddata->sw_reset)) {
- dev_err(dev, "Failed to get S/W Reset\n");
- return PTR_ERR(ddata->sw_reset);
- }
+ if (IS_ERR(ddata->sw_reset))
+ return dev_err_probe(dev, PTR_ERR(ddata->sw_reset),
+ "Failed to get S/W Reset\n");
}
if (ddata->config->pwr_reset) {
ddata->pwr_reset = devm_reset_control_get_exclusive(dev,
"pwr_reset");
- if (IS_ERR(ddata->pwr_reset)) {
- dev_err(dev, "Failed to get Power Reset\n");
- return PTR_ERR(ddata->pwr_reset);
- }
+ if (IS_ERR(ddata->pwr_reset))
+ return dev_err_probe(dev, PTR_ERR(ddata->pwr_reset),
+ "Failed to get Power Reset\n");
}
ddata->clk = devm_clk_get(dev, NULL);
- if (IS_ERR(ddata->clk)) {
- dev_err(dev, "Failed to get clock\n");
- return PTR_ERR(ddata->clk);
- }
+ if (IS_ERR(ddata->clk))
+ return dev_err_probe(dev, PTR_ERR(ddata->clk),
+ "Failed to get clock\n");
err = of_property_read_u32(np, "clock-frequency", &ddata->clk_rate);
if (err) {
@@ -318,10 +315,9 @@ static int st_rproc_parse_dt(struct platform_device *pdev)
}
ddata->boot_base = syscon_regmap_lookup_by_phandle(np, "st,syscfg");
- if (IS_ERR(ddata->boot_base)) {
- dev_err(dev, "Boot base not found\n");
- return PTR_ERR(ddata->boot_base);
- }
+ 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);
@@ -395,32 +391,32 @@ static int st_rproc_probe(struct platform_device *pdev)
*/
chan = mbox_request_channel_byname(&ddata->mbox_client_vq0, "vq0_rx");
if (IS_ERR(chan)) {
- dev_err(&rproc->dev, "failed to request mbox chan 0\n");
- ret = PTR_ERR(chan);
+ ret = dev_err_probe(&rproc->dev, PTR_ERR(chan),
+ "failed to request mbox chan 0\n");
goto free_clk;
}
ddata->mbox_chan[ST_RPROC_VQ0 * MBOX_MAX + MBOX_RX] = chan;
chan = mbox_request_channel_byname(&ddata->mbox_client_vq0, "vq0_tx");
if (IS_ERR(chan)) {
- dev_err(&rproc->dev, "failed to request mbox chan 0\n");
- ret = PTR_ERR(chan);
+ ret = dev_err_probe(&rproc->dev, PTR_ERR(chan),
+ "failed to request mbox chan 0\n");
goto free_mbox;
}
ddata->mbox_chan[ST_RPROC_VQ0 * MBOX_MAX + MBOX_TX] = chan;
chan = mbox_request_channel_byname(&ddata->mbox_client_vq1, "vq1_rx");
if (IS_ERR(chan)) {
- dev_err(&rproc->dev, "failed to request mbox chan 1\n");
- ret = PTR_ERR(chan);
+ ret = dev_err_probe(&rproc->dev, PTR_ERR(chan),
+ "failed to request mbox chan 1\n");
goto free_mbox;
}
ddata->mbox_chan[ST_RPROC_VQ1 * MBOX_MAX + MBOX_RX] = chan;
chan = mbox_request_channel_byname(&ddata->mbox_client_vq1, "vq1_tx");
if (IS_ERR(chan)) {
- dev_err(&rproc->dev, "failed to request mbox chan 1\n");
- ret = PTR_ERR(chan);
+ ret = dev_err_probe(&rproc->dev, PTR_ERR(chan),
+ "failed to request mbox chan 1\n");
goto free_mbox;
}
ddata->mbox_chan[ST_RPROC_VQ1 * MBOX_MAX + MBOX_TX] = chan;
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 3/5] remoteproc: st: Simplify with dev_err_probe
2025-01-11 18:42 ` [PATCH 3/5] remoteproc: st: Simplify with dev_err_probe Krzysztof Kozlowski
@ 2025-01-13 8:23 ` Patrice CHOTARD
0 siblings, 0 replies; 9+ messages in thread
From: Patrice CHOTARD @ 2025-01-13 8:23 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Mathieu Poirier
Cc: linux-remoteproc, linux-kernel, linux-arm-kernel
On 1/11/25 19:42, Krzysztof Kozlowski wrote:
> Use dev_err_probe() to make error code handling simpler and handle
> deferred probe.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> drivers/remoteproc/st_remoteproc.c | 44 +++++++++++++++++---------------------
> 1 file changed, 20 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c
> index 5df99bae7131a832c0c03c9bf8619812d9eb570d..d1f35e8a83ba525613ed4e54d2269b7e9f427e46 100644
> --- a/drivers/remoteproc/st_remoteproc.c
> +++ b/drivers/remoteproc/st_remoteproc.c
> @@ -290,26 +290,23 @@ static int st_rproc_parse_dt(struct platform_device *pdev)
> if (ddata->config->sw_reset) {
> ddata->sw_reset = devm_reset_control_get_exclusive(dev,
> "sw_reset");
> - if (IS_ERR(ddata->sw_reset)) {
> - dev_err(dev, "Failed to get S/W Reset\n");
> - return PTR_ERR(ddata->sw_reset);
> - }
> + if (IS_ERR(ddata->sw_reset))
> + return dev_err_probe(dev, PTR_ERR(ddata->sw_reset),
> + "Failed to get S/W Reset\n");
> }
>
> if (ddata->config->pwr_reset) {
> ddata->pwr_reset = devm_reset_control_get_exclusive(dev,
> "pwr_reset");
> - if (IS_ERR(ddata->pwr_reset)) {
> - dev_err(dev, "Failed to get Power Reset\n");
> - return PTR_ERR(ddata->pwr_reset);
> - }
> + if (IS_ERR(ddata->pwr_reset))
> + return dev_err_probe(dev, PTR_ERR(ddata->pwr_reset),
> + "Failed to get Power Reset\n");
> }
>
> ddata->clk = devm_clk_get(dev, NULL);
> - if (IS_ERR(ddata->clk)) {
> - dev_err(dev, "Failed to get clock\n");
> - return PTR_ERR(ddata->clk);
> - }
> + if (IS_ERR(ddata->clk))
> + return dev_err_probe(dev, PTR_ERR(ddata->clk),
> + "Failed to get clock\n");
>
> err = of_property_read_u32(np, "clock-frequency", &ddata->clk_rate);
> if (err) {
> @@ -318,10 +315,9 @@ static int st_rproc_parse_dt(struct platform_device *pdev)
> }
>
> ddata->boot_base = syscon_regmap_lookup_by_phandle(np, "st,syscfg");
> - if (IS_ERR(ddata->boot_base)) {
> - dev_err(dev, "Boot base not found\n");
> - return PTR_ERR(ddata->boot_base);
> - }
> + 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);
> @@ -395,32 +391,32 @@ static int st_rproc_probe(struct platform_device *pdev)
> */
> chan = mbox_request_channel_byname(&ddata->mbox_client_vq0, "vq0_rx");
> if (IS_ERR(chan)) {
> - dev_err(&rproc->dev, "failed to request mbox chan 0\n");
> - ret = PTR_ERR(chan);
> + ret = dev_err_probe(&rproc->dev, PTR_ERR(chan),
> + "failed to request mbox chan 0\n");
> goto free_clk;
> }
> ddata->mbox_chan[ST_RPROC_VQ0 * MBOX_MAX + MBOX_RX] = chan;
>
> chan = mbox_request_channel_byname(&ddata->mbox_client_vq0, "vq0_tx");
> if (IS_ERR(chan)) {
> - dev_err(&rproc->dev, "failed to request mbox chan 0\n");
> - ret = PTR_ERR(chan);
> + ret = dev_err_probe(&rproc->dev, PTR_ERR(chan),
> + "failed to request mbox chan 0\n");
> goto free_mbox;
> }
> ddata->mbox_chan[ST_RPROC_VQ0 * MBOX_MAX + MBOX_TX] = chan;
>
> chan = mbox_request_channel_byname(&ddata->mbox_client_vq1, "vq1_rx");
> if (IS_ERR(chan)) {
> - dev_err(&rproc->dev, "failed to request mbox chan 1\n");
> - ret = PTR_ERR(chan);
> + ret = dev_err_probe(&rproc->dev, PTR_ERR(chan),
> + "failed to request mbox chan 1\n");
> goto free_mbox;
> }
> ddata->mbox_chan[ST_RPROC_VQ1 * MBOX_MAX + MBOX_RX] = chan;
>
> chan = mbox_request_channel_byname(&ddata->mbox_client_vq1, "vq1_tx");
> if (IS_ERR(chan)) {
> - dev_err(&rproc->dev, "failed to request mbox chan 1\n");
> - ret = PTR_ERR(chan);
> + ret = dev_err_probe(&rproc->dev, PTR_ERR(chan),
> + "failed to request mbox chan 1\n");
> goto free_mbox;
> }
> ddata->mbox_chan[ST_RPROC_VQ1 * MBOX_MAX + MBOX_TX] = chan;
>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Thanks
Patrice
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 4/5] remoteproc: keystone: Use syscon_regmap_lookup_by_phandle_args
2025-01-11 18:42 [PATCH 0/5] remoteproc: Simplify few things: omap, keystone, st Krzysztof Kozlowski
` (2 preceding siblings ...)
2025-01-11 18:42 ` [PATCH 3/5] remoteproc: st: Simplify with dev_err_probe Krzysztof Kozlowski
@ 2025-01-11 18:42 ` Krzysztof Kozlowski
2025-01-11 18:42 ` [PATCH 5/5] remoteproc: st: " Krzysztof Kozlowski
2025-01-15 17:07 ` [PATCH 0/5] remoteproc: Simplify few things: omap, keystone, st Mathieu Poirier
5 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-11 18:42 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Patrice Chotard
Cc: linux-remoteproc, linux-kernel, linux-arm-kernel,
Krzysztof Kozlowski
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/keystone_remoteproc.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/remoteproc/keystone_remoteproc.c b/drivers/remoteproc/keystone_remoteproc.c
index 83c8e568f7ce3ec3ca3a534d2566f6437e9d403a..7b41b4547fa803fe19d5e5e6b1a8c8c4e5760632 100644
--- a/drivers/remoteproc/keystone_remoteproc.c
+++ b/drivers/remoteproc/keystone_remoteproc.c
@@ -341,17 +341,11 @@ static int keystone_rproc_of_get_dev_syscon(struct platform_device *pdev,
return -EINVAL;
}
- ksproc->dev_ctrl =
- syscon_regmap_lookup_by_phandle(np, "ti,syscon-dev");
+ ksproc->dev_ctrl = syscon_regmap_lookup_by_phandle_args(np, "ti,syscon-dev",
+ 1, &ksproc->boot_offset);
if (IS_ERR(ksproc->dev_ctrl))
return PTR_ERR(ksproc->dev_ctrl);
- if (of_property_read_u32_index(np, "ti,syscon-dev", 1,
- &ksproc->boot_offset)) {
- dev_err(dev, "couldn't read the boot register offset\n");
- return -EINVAL;
- }
-
return 0;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 5/5] remoteproc: st: Use syscon_regmap_lookup_by_phandle_args
2025-01-11 18:42 [PATCH 0/5] remoteproc: Simplify few things: omap, keystone, st Krzysztof Kozlowski
` (3 preceding siblings ...)
2025-01-11 18:42 ` [PATCH 4/5] remoteproc: keystone: Use syscon_regmap_lookup_by_phandle_args Krzysztof Kozlowski
@ 2025-01-11 18:42 ` Krzysztof Kozlowski
2025-01-13 8:25 ` Patrice CHOTARD
2025-01-15 17:07 ` [PATCH 0/5] remoteproc: Simplify few things: omap, keystone, st Mathieu Poirier
5 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-11 18:42 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Patrice Chotard
Cc: linux-remoteproc, linux-kernel, linux-arm-kernel,
Krzysztof Kozlowski
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");
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 5/5] remoteproc: st: Use syscon_regmap_lookup_by_phandle_args
2025-01-11 18:42 ` [PATCH 5/5] remoteproc: st: " Krzysztof Kozlowski
@ 2025-01-13 8:25 ` Patrice CHOTARD
0 siblings, 0 replies; 9+ messages in thread
From: Patrice CHOTARD @ 2025-01-13 8:25 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Mathieu Poirier
Cc: linux-remoteproc, linux-kernel, linux-arm-kernel
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/5] remoteproc: Simplify few things: omap, keystone, st
2025-01-11 18:42 [PATCH 0/5] remoteproc: Simplify few things: omap, keystone, st Krzysztof Kozlowski
` (4 preceding siblings ...)
2025-01-11 18:42 ` [PATCH 5/5] remoteproc: st: " Krzysztof Kozlowski
@ 2025-01-15 17:07 ` Mathieu Poirier
5 siblings, 0 replies; 9+ messages in thread
From: Mathieu Poirier @ 2025-01-15 17:07 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Bjorn Andersson, Patrice Chotard, linux-remoteproc, linux-kernel,
linux-arm-kernel
On Sat, Jan 11, 2025 at 07:42:48PM +0100, Krzysztof Kozlowski wrote:
> Few code simplifications without functional impact. Not tested on
> hardware.
>
> Best regards,
> Krzysztof
>
> ---
> Krzysztof Kozlowski (5):
> remoteproc: keystone: Simplify returning syscon PTR_ERR
> remoteproc: omap: Simplify returning syscon PTR_ERR
> remoteproc: st: Simplify with dev_err_probe
> remoteproc: keystone: Use syscon_regmap_lookup_by_phandle_args
> remoteproc: st: Use syscon_regmap_lookup_by_phandle_args
>
> drivers/remoteproc/keystone_remoteproc.c | 17 +++-------
> drivers/remoteproc/omap_remoteproc.c | 7 ++---
> drivers/remoteproc/st_remoteproc.c | 54 +++++++++++++-------------------
> 3 files changed, 28 insertions(+), 50 deletions(-)
I have applied this set.
Thanks,
Mathieu
> ---
> base-commit: 6ecd20965bdc21b265a0671ccf36d9ad8043f5ab
> change-id: 20250111-b4-syscon-phandle-args-remoteproc-06dfa873d1d1
>
> Best regards,
> --
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
^ permalink raw reply [flat|nested] 9+ messages in thread