Skip to content

Commit 55e2a6e

Browse files
arndbmchehab
authored andcommitted
media: nxp: ignore unused suspend operations
gcc warns about some functions being unused when CONFIG_PM_SLEEP is disabled: drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c:328:12: error: 'mxc_isi_pm_resume' defined but not used [-Werror=unused-function] 328 | static int mxc_isi_pm_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~ drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c:314:12: error: 'mxc_isi_pm_suspend' defined but not used [-Werror=unused-function] 314 | static int mxc_isi_pm_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~ Use the modern SYSTEM_SLEEP_PM_OPS()/RUNTIME_PM_OPS() helpers in place of the old SET_SYSTEM_SLEEP_PM_OPS()/SET_RUNTIME_PM_OPS() ones. By convention, use pm_ptr() to guard the reference to the operations. This makes no difference as long as the driver requires CONFIG_PM, but is what users of SET_RUNTIME_PM_OPS() are supposed to do. Fixes: cf21f32 ("media: nxp: Add i.MX8 ISI driver") Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent e10707d commit 55e2a6e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ static int mxc_isi_runtime_resume(struct device *dev)
378378
}
379379

380380
static const struct dev_pm_ops mxc_isi_pm_ops = {
381-
SET_SYSTEM_SLEEP_PM_OPS(mxc_isi_pm_suspend, mxc_isi_pm_resume)
382-
SET_RUNTIME_PM_OPS(mxc_isi_runtime_suspend, mxc_isi_runtime_resume, NULL)
381+
SYSTEM_SLEEP_PM_OPS(mxc_isi_pm_suspend, mxc_isi_pm_resume)
382+
RUNTIME_PM_OPS(mxc_isi_runtime_suspend, mxc_isi_runtime_resume, NULL)
383383
};
384384

385385
/* -----------------------------------------------------------------------------
@@ -528,7 +528,7 @@ static struct platform_driver mxc_isi_driver = {
528528
.driver = {
529529
.of_match_table = mxc_isi_of_match,
530530
.name = MXC_ISI_DRIVER_NAME,
531-
.pm = &mxc_isi_pm_ops,
531+
.pm = pm_ptr(&mxc_isi_pm_ops),
532532
}
533533
};
534534
module_platform_driver(mxc_isi_driver);

0 commit comments

Comments
 (0)