Re: [PATCH 06/26] drm: sun4i: Use the dev_pm_ops provided by modeset helper

2022-11-13 Thread Samuel Holland
On 11/7/22 11:50, Paul Cercueil wrote:
> Use the drm_mode_config_pm_ops structure exported by
> drm_modeset_helper.c, which provides the exact same PM callbacks.
> 
> Signed-off-by: Paul Cercueil 
> ---
> Cc: Maxime Ripard 
> Cc: Chen-Yu Tsai 
> Cc: Jernej Skrabec 
> Cc: Samuel Holland 
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-su...@lists.linux.dev
> ---
>  drivers/gpu/drm/sun4i/sun4i_drv.c | 24 ++--
>  1 file changed, 2 insertions(+), 22 deletions(-)

Reviewed-by: Samuel Holland 



[PATCH 06/26] drm: sun4i: Use the dev_pm_ops provided by modeset helper

2022-11-07 Thread Paul Cercueil
Use the drm_mode_config_pm_ops structure exported by
drm_modeset_helper.c, which provides the exact same PM callbacks.

Signed-off-by: Paul Cercueil 
---
Cc: Maxime Ripard 
Cc: Chen-Yu Tsai 
Cc: Jernej Skrabec 
Cc: Samuel Holland 
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-su...@lists.linux.dev
---
 drivers/gpu/drm/sun4i/sun4i_drv.c | 24 ++--
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c 
b/drivers/gpu/drm/sun4i/sun4i_drv.c
index d06ffd99d86e..8147b2abe5ba 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -339,27 +340,6 @@ static int sun4i_drv_add_endpoints(struct device *dev,
return count;
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int sun4i_drv_drm_sys_suspend(struct device *dev)
-{
-   struct drm_device *drm = dev_get_drvdata(dev);
-
-   return drm_mode_config_helper_suspend(drm);
-}
-
-static int sun4i_drv_drm_sys_resume(struct device *dev)
-{
-   struct drm_device *drm = dev_get_drvdata(dev);
-
-   return drm_mode_config_helper_resume(drm);
-}
-#endif
-
-static const struct dev_pm_ops sun4i_drv_drm_pm_ops = {
-   SET_SYSTEM_SLEEP_PM_OPS(sun4i_drv_drm_sys_suspend,
-   sun4i_drv_drm_sys_resume)
-};
-
 static int sun4i_drv_probe(struct platform_device *pdev)
 {
struct component_match *match = NULL;
@@ -440,7 +420,7 @@ static struct platform_driver sun4i_drv_platform_driver = {
.driver = {
.name   = "sun4i-drm",
.of_match_table = sun4i_drv_of_table,
-   .pm = _drv_drm_pm_ops,
+   .pm = pm_sleep_ptr(_mode_config_pm_ops),
},
 };
 drm_module_platform_driver(sun4i_drv_platform_driver);
-- 
2.35.1