summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBen Levinsky <ben.levinsky@amd.com>2026-05-28 19:16:37 -0700
committerMathieu Poirier <mathieu.poirier@linaro.org>2026-06-29 09:34:18 -0600
commit65bb7dee37f1858d5920e9bfd48f7cd96bf421e4 (patch)
treecf41f9a167cdc245d103d55c43908351b8552527 /drivers
parente6b4e660f08894ef8fa2aaee3ef5c0f86ae4c59d (diff)
downloadlinux-next-65bb7dee37f1858d5920e9bfd48f7cd96bf421e4.tar.gz
linux-next-65bb7dee37f1858d5920e9bfd48f7cd96bf421e4.zip
remoteproc: Switch drivers to optional resource-table helper
Use the shared optional resource-table helper in the remoteproc drivers that already treat a missing resource table as non-fatal: xlnx_r5_remoteproc, rcar_rproc, stm32_rproc, imx_rproc, and imx_dsp_rproc. Keep thin local parse_fw() wrappers in each driver so the helper only centralizes the return-value handling while each platform retains control over whether the missing-table case is logged and at what severity. Signed-off-by: Ben Levinsky <ben.levinsky@amd.com> Tested-by: Peng Fan <peng.fan@nxp.com> #i.MX8MP-EVK Link: https://lore.kernel.org/r/20260529021637.2077602-6-ben.levinsky@amd.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/remoteproc/imx_dsp_rproc.c5
-rw-r--r--drivers/remoteproc/imx_rproc.c8
-rw-r--r--drivers/remoteproc/rcar_rproc.c8
-rw-r--r--drivers/remoteproc/stm32_rproc.c6
-rw-r--r--drivers/remoteproc/xlnx_r5_remoteproc.c23
5 files changed, 17 insertions, 33 deletions
diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
index 2d9f14fbef1d..fd60c67ba8a9 100644
--- a/drivers/remoteproc/imx_dsp_rproc.c
+++ b/drivers/remoteproc/imx_dsp_rproc.c
@@ -956,9 +956,8 @@ static int imx_dsp_rproc_elf_load_segments(struct rproc *rproc, const struct fir
static int imx_dsp_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
{
- if (rproc_elf_load_rsc_table(rproc, fw))
- dev_warn(&rproc->dev, "no resource table found for this firmware\n");
-
+ rproc_elf_load_rsc_table_optional(rproc, fw, dev_warn,
+ "no resource table found for this firmware\n");
return 0;
}
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index bb23ebc15d64..745ce52cd822 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -682,12 +682,8 @@ static int imx_rproc_prepare(struct rproc *rproc)
static int imx_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
{
- int ret;
-
- ret = rproc_elf_load_rsc_table(rproc, fw);
- if (ret)
- dev_info(&rproc->dev, "No resource table in elf\n");
-
+ rproc_elf_load_rsc_table_optional(rproc, fw, dev_info,
+ "No resource table in elf\n");
return 0;
}
diff --git a/drivers/remoteproc/rcar_rproc.c b/drivers/remoteproc/rcar_rproc.c
index e3121fadd292..1fe6c01bde40 100644
--- a/drivers/remoteproc/rcar_rproc.c
+++ b/drivers/remoteproc/rcar_rproc.c
@@ -57,12 +57,8 @@ static int rcar_rproc_prepare(struct rproc *rproc)
static int rcar_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
{
- int ret;
-
- ret = rproc_elf_load_rsc_table(rproc, fw);
- if (ret)
- dev_info(&rproc->dev, "No resource table in elf\n");
-
+ rproc_elf_load_rsc_table_optional(rproc, fw, dev_info,
+ "No resource table in elf\n");
return 0;
}
diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
index a6e36a11627d..0e5d64fbe52c 100644
--- a/drivers/remoteproc/stm32_rproc.c
+++ b/drivers/remoteproc/stm32_rproc.c
@@ -234,9 +234,8 @@ static int stm32_rproc_prepare(struct rproc *rproc)
static int stm32_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
{
- if (rproc_elf_load_rsc_table(rproc, fw))
- dev_warn(&rproc->dev, "no resource table found for this firmware\n");
-
+ rproc_elf_load_rsc_table_optional(rproc, fw, dev_warn,
+ "no resource table found for this firmware\n");
return 0;
}
@@ -928,4 +927,3 @@ MODULE_DESCRIPTION("STM32 Remote Processor Control Driver");
MODULE_AUTHOR("Ludovic Barre <ludovic.barre@st.com>");
MODULE_AUTHOR("Fabien Dessenne <fabien.dessenne@st.com>");
MODULE_LICENSE("GPL v2");
-
diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c
index 59e7b10a6f26..7000f08975f0 100644
--- a/drivers/remoteproc/xlnx_r5_remoteproc.c
+++ b/drivers/remoteproc/xlnx_r5_remoteproc.c
@@ -679,20 +679,15 @@ release_tcm:
*/
static int zynqmp_r5_parse_fw(struct rproc *rproc, const struct firmware *fw)
{
- int ret;
-
- ret = rproc_elf_load_rsc_table(rproc, fw);
- if (ret == -EINVAL) {
- /*
- * resource table only required for IPC.
- * if not present, this is not necessarily an error;
- * for example, loading r5 hello world application
- * so simply inform user and keep going.
- */
- dev_info(&rproc->dev, "no resource table found.\n");
- ret = 0;
- }
- return ret;
+ /*
+ * resource table only required for IPC.
+ * if not present, this is not necessarily an error;
+ * for example, loading r5 hello world application
+ * so simply inform user and keep going.
+ */
+ rproc_elf_load_rsc_table_optional(rproc, fw, dev_info,
+ "no resource table found.\n");
+ return 0;
}
/**