Replace error logging and return handling in rproc_of_parse_firmware() and
imx_dsp_rproc_detect_mode() with dev_err_probe() to streamline error
reporting and improve consistency.

Reduces boilerplate and aligns with modern kernel error handling practices.

Signed-off-by: Peng Fan <[email protected]>
---
 drivers/remoteproc/imx_dsp_rproc.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/remoteproc/imx_dsp_rproc.c 
b/drivers/remoteproc/imx_dsp_rproc.c
index 
f5d0aec52c56664d6074272e276edb0c4175c9ea..87f4a026c05fbf1c9371058290b2d33cb94b9e54
 100644
--- a/drivers/remoteproc/imx_dsp_rproc.c
+++ b/drivers/remoteproc/imx_dsp_rproc.c
@@ -1150,11 +1150,8 @@ static int imx_dsp_rproc_probe(struct platform_device 
*pdev)
                return -ENODEV;
 
        ret = rproc_of_parse_firmware(dev, 0, &fw_name);
-       if (ret) {
-               dev_err(dev, "failed to parse firmware-name property, ret = 
%d\n",
-                       ret);
-               return ret;
-       }
+       if (ret)
+               return dev_err_probe(dev, ret, "failed to parse firmware-name 
property\n");
 
        rproc = devm_rproc_alloc(dev, "imx-dsp-rproc", &imx_dsp_rproc_ops,
                                 fw_name, sizeof(*priv));
@@ -1177,10 +1174,8 @@ static int imx_dsp_rproc_probe(struct platform_device 
*pdev)
        INIT_WORK(&priv->rproc_work, imx_dsp_rproc_vq_work);
 
        ret = imx_dsp_rproc_detect_mode(priv);
-       if (ret) {
-               dev_err(dev, "failed on imx_dsp_rproc_detect_mode\n");
-               return ret;
-       }
+       if (ret)
+               return dev_err_probe(dev, ret, "failed on 
imx_dsp_rproc_detect_mode\n");
 
        /* There are multiple power domains required by DSP on some platform */
        ret = imx_dsp_attach_pm_domains(priv);

-- 
2.37.1


Reply via email to