v4l: xilinx: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Subsystems (3)
PATCH 1/1 v4l: xilinx: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Convert the deprecated SIMPLE_DEV_PM_OPS
to DEFINE_SIMPLE_DEV_PM_OPS
and pm_sleep_ptr().
This lets us drop the __maybe_unused annotations
from its suspend and resume callbacks,
also reduces kernel size in case CONFIG_PM orCONFIG_PM_SLEEP is disabled.
Signed-off-by Triet Hoang <[email protected]>
--- drivers/media/platform/xilinx/xilinx-tpg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/platform/xilinx/xilinx-tpg.c +4 -4
@@ -686,7 +686,7 @@ static const struct media_entity_operations xtpg_media_ops = {* Power Management */ -static int __maybe_unused xtpg_pm_suspend (struct device *dev) +static int xtpg_pm_suspend (struct device *dev) {struct xtpg_device *xtpg =dev_get_drvdata (dev);
@@ -695,7 +695,7 @@ static int __maybe_unused xtpg_pm_suspend(struct device *dev)return 0 ; } -static int __maybe_unused xtpg_pm_resume (struct device *dev) +static int xtpg_pm_resume (struct device *dev) {struct xtpg_device *xtpg =dev_get_drvdata (dev);
@@ -895,7 +895,7 @@ static void xtpg_remove(struct platform_device *pdev)xvip_cleanup_resources (&xtpg->xvip); } -static SIMPLE_DEV_PM_OPS(xtpg_pm_ops, xtpg_pm_suspend, xtpg_pm_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(xtpg_pm_ops, xtpg_pm_suspend, xtpg_pm_resume);static const struct of_device_id xtpg_of_id_table[] = { { .compatible ="xlnx,v-tpg-5.0" },
@@ -906,7 +906,7 @@ MODULE_DEVICE_TABLE(of, xtpg_of_id_table);static struct platform_driver xtpg_driver = { .driver = { .name ="xilinx-tpg" , - .pm = &xtpg_pm_ops, + .pm =pm_sleep_ptr (&xtpg_pm_ops), .of_match_table = xtpg_of_id_table, }, .probe = xtpg_probe,
Signature · 1 line
2.53.0
Laurent Pinchart
maintainerHi Triet,
Thank you for the patch.
I'm CC'ing Tomi Valkeinen who is currently working on the Xilinx V4L2 drivers. Tomi, could you handle this patch ?
Quoted 54 lines · Triet Hoang
Convert the deprecated
SIMPLE_DEV_PM_OPS
toDEFINE_SIMPLE_DEV_PM_OPS
andpm_sleep_ptr().This lets us drop the
__maybe_unusedannotations
from its suspend and resume callbacks,
also reduces kernel size in caseCONFIG_PMorCONFIG_PM_SLEEPis disabled.Signed-off-by Triet Hoang <[email protected]>--- drivers/media/platform/xilinx/xilinx-tpg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/media/platform/xilinx/xilinx-tpg.c +4
-4@@ -686,7 +686,7 @@ static const struct media_entity_operations xtpg_media_ops = {* Power Management */ -static int __maybe_unused xtpg_pm_suspend (struct device *dev) +static int xtpg_pm_suspend (struct device *dev) {struct xtpg_device *xtpg =dev_get_drvdata (dev);@@ -695,7 +695,7 @@ static int __maybe_unused xtpg_pm_suspend(struct device *dev)return 0 ; } -static int __maybe_unused xtpg_pm_resume (struct device *dev) +static int xtpg_pm_resume (struct device *dev) {struct xtpg_device *xtpg =dev_get_drvdata (dev);@@ -895,7 +895,7 @@ static void xtpg_remove(struct platform_device *pdev)xvip_cleanup_resources (&xtpg->xvip); } -static SIMPLE_DEV_PM_OPS(xtpg_pm_ops, xtpg_pm_suspend, xtpg_pm_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(xtpg_pm_ops, xtpg_pm_suspend, xtpg_pm_resume);static const struct of_device_id xtpg_of_id_table[] = { { .compatible ="xlnx,v-tpg-5.0" },@@ -906,7 +906,7 @@ MODULE_DEVICE_TABLE(of, xtpg_of_id_table);static struct platform_driver xtpg_driver = { .driver = { .name ="xilinx-tpg" , - .pm = &xtpg_pm_ops, + .pm =pm_sleep_ptr (&xtpg_pm_ops), .of_match_table = xtpg_of_id_table, }, .probe = xtpg_probe,
Signature · 3 lines
Regards, Laurent Pinchart