diff options
author | Paul Cercueil <paul@crapouillou.net> | 2022-07-08 21:54:06 +0100 |
---|---|---|
committer | Paul Cercueil <paul@crapouillou.net> | 2022-07-09 16:52:14 +0100 |
commit | 006f3b2f324cb2277bdcb89693296d9647ece251 (patch) | |
tree | 1260ba61c57ce96063ead894897c02da5829ba64 /drivers | |
parent | c167ee1f75ca5947bafe93ab23b007cb243e5f4a (diff) | |
download | lwn-006f3b2f324cb2277bdcb89693296d9647ece251.tar.gz lwn-006f3b2f324cb2277bdcb89693296d9647ece251.zip |
drm/ingenic: Use the new PM macros
- Use DEFINE_SIMPLE_DEV_PM_OPS() instead of the SIMPLE_DEV_PM_OPS()
macro. This makes it possible to remove the __maybe_unused flags on
the callback functions.
- Since we only have callbacks for suspend/resume, we can conditionally
compile the dev_pm_ops structure for when CONFIG_PM_SLEEP is enabled;
so use the pm_sleep_ptr() macro instead of pm_ptr().
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220708205406.96473-7-paul@crapouillou.net
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index 78d0b035e2d7..4de729bbf152 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -1464,21 +1464,22 @@ static int ingenic_drm_remove(struct platform_device *pdev) return 0; } -static int __maybe_unused ingenic_drm_suspend(struct device *dev) +static int ingenic_drm_suspend(struct device *dev) { struct ingenic_drm *priv = dev_get_drvdata(dev); return drm_mode_config_helper_suspend(&priv->drm); } -static int __maybe_unused ingenic_drm_resume(struct device *dev) +static int ingenic_drm_resume(struct device *dev) { struct ingenic_drm *priv = dev_get_drvdata(dev); return drm_mode_config_helper_resume(&priv->drm); } -static SIMPLE_DEV_PM_OPS(ingenic_drm_pm_ops, ingenic_drm_suspend, ingenic_drm_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ingenic_drm_pm_ops, + ingenic_drm_suspend, ingenic_drm_resume); static const u32 jz4740_formats[] = { DRM_FORMAT_XRGB1555, @@ -1609,7 +1610,7 @@ MODULE_DEVICE_TABLE(of, ingenic_drm_of_match); static struct platform_driver ingenic_drm_driver = { .driver = { .name = "ingenic-drm", - .pm = pm_ptr(&ingenic_drm_pm_ops), + .pm = pm_sleep_ptr(&ingenic_drm_pm_ops), .of_match_table = of_match_ptr(ingenic_drm_of_match), }, .probe = ingenic_drm_probe, |