mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 05:04:02 +02:00
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>
This commit is contained in:
parent
e6b4e660f0
commit
65bb7dee37
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
|
|
@ -679,20 +679,15 @@ static int add_tcm_banks(struct rproc *rproc)
|
|||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user