Skip to content

Commit 47f64e7

Browse files
arndbmathieupoirier
authored andcommitted
remoteproc: imx_dsp_rproc: use modern pm_ops
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>
1 parent 52ca331 commit 47f64e7

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

drivers/remoteproc/imx_dsp_rproc.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ static void imx_dsp_load_firmware(const struct firmware *fw, void *context)
12411241
release_firmware(fw);
12421242
}
12431243

1244-
static __maybe_unused int imx_dsp_suspend(struct device *dev)
1244+
static int imx_dsp_suspend(struct device *dev)
12451245
{
12461246
struct rproc *rproc = dev_get_drvdata(dev);
12471247
struct imx_dsp_rproc *priv = rproc->priv;
@@ -1276,7 +1276,7 @@ static __maybe_unused int imx_dsp_suspend(struct device *dev)
12761276
return pm_runtime_force_suspend(dev);
12771277
}
12781278

1279-
static __maybe_unused int imx_dsp_resume(struct device *dev)
1279+
static int imx_dsp_resume(struct device *dev)
12801280
{
12811281
struct rproc *rproc = dev_get_drvdata(dev);
12821282
int ret = 0;
@@ -1310,9 +1310,8 @@ static __maybe_unused int imx_dsp_resume(struct device *dev)
13101310
}
13111311

13121312
static const struct dev_pm_ops imx_dsp_rproc_pm_ops = {
1313-
SET_SYSTEM_SLEEP_PM_OPS(imx_dsp_suspend, imx_dsp_resume)
1314-
SET_RUNTIME_PM_OPS(imx_dsp_runtime_suspend,
1315-
imx_dsp_runtime_resume, NULL)
1313+
SYSTEM_SLEEP_PM_OPS(imx_dsp_suspend, imx_dsp_resume)
1314+
RUNTIME_PM_OPS(imx_dsp_runtime_suspend, imx_dsp_runtime_resume, NULL)
13161315
};
13171316

13181317
static const struct of_device_id imx_dsp_rproc_of_match[] = {
@@ -1330,7 +1329,7 @@ static struct platform_driver imx_dsp_rproc_driver = {
13301329
.driver = {
13311330
.name = "imx-dsp-rproc",
13321331
.of_match_table = imx_dsp_rproc_of_match,
1333-
.pm = &imx_dsp_rproc_pm_ops,
1332+
.pm = pm_ptr(&imx_dsp_rproc_pm_ops),
13341333
},
13351334
};
13361335
module_platform_driver(imx_dsp_rproc_driver);

0 commit comments

Comments
 (0)