remoteproc: imx_dsp_rproc: use modern pm_ops
authorArnd Bergmann <arnd@arndb.de>
Thu, 20 Apr 2023 21:36:04 +0000 (23:36 +0200)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Tue, 9 May 2023 19:48:54 +0000 (13:48 -0600)
Without CONFIG_PM, the driver warns about unused functions:

drivers/remoteproc/imx_dsp_rproc.c:1210:12: error: 'imx_dsp_runtime_suspend' defined but not used [-Werror=unused-function]
 1210 | static int imx_dsp_runtime_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~
drivers/remoteproc/imx_dsp_rproc.c:1178:12: error: 'imx_dsp_runtime_resume' defined but not used [-Werror=unused-function]
 1178 | static int imx_dsp_runtime_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~

Change the old SET_SYSTEM_SLEEP_PM_OPS()/SET_RUNTIME_PM_OPS()
helpers to their modern replacements that avoid the warning,
and remove the now unnecessary __maybe_unused annotations
on the other PM helper functions.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Mukesh Ojha <quic_mojha@quicinc.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Link: https://lore.kernel.org/r/20230420213610.2219080-1-arnd@kernel.org
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/remoteproc/imx_dsp_rproc.c

index bda7f2a910e0ccfb2fb3c47df7253c3e9ce1a77e..d95fa558618998b433b8c7467b6a1143cfa5131b 100644 (file)
@@ -1241,7 +1241,7 @@ out:
        release_firmware(fw);
 }
 
-static __maybe_unused int imx_dsp_suspend(struct device *dev)
+static int imx_dsp_suspend(struct device *dev)
 {
        struct rproc *rproc = dev_get_drvdata(dev);
        struct imx_dsp_rproc *priv = rproc->priv;
@@ -1276,7 +1276,7 @@ out:
        return pm_runtime_force_suspend(dev);
 }
 
-static __maybe_unused int imx_dsp_resume(struct device *dev)
+static int imx_dsp_resume(struct device *dev)
 {
        struct rproc *rproc = dev_get_drvdata(dev);
        int ret = 0;
@@ -1310,9 +1310,8 @@ err:
 }
 
 static const struct dev_pm_ops imx_dsp_rproc_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(imx_dsp_suspend, imx_dsp_resume)
-       SET_RUNTIME_PM_OPS(imx_dsp_runtime_suspend,
-                          imx_dsp_runtime_resume, NULL)
+       SYSTEM_SLEEP_PM_OPS(imx_dsp_suspend, imx_dsp_resume)
+       RUNTIME_PM_OPS(imx_dsp_runtime_suspend, imx_dsp_runtime_resume, NULL)
 };
 
 static const struct of_device_id imx_dsp_rproc_of_match[] = {
@@ -1330,7 +1329,7 @@ static struct platform_driver imx_dsp_rproc_driver = {
        .driver = {
                .name = "imx-dsp-rproc",
                .of_match_table = imx_dsp_rproc_of_match,
-               .pm = &imx_dsp_rproc_pm_ops,
+               .pm = pm_ptr(&imx_dsp_rproc_pm_ops),
        },
 };
 module_platform_driver(imx_dsp_rproc_driver);