[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221129191942.138244-10-paul@crapouillou.net>
Date: Tue, 29 Nov 2022 19:19:39 +0000
From: Paul Cercueil <paul@...pouillou.net>
To: David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
Paul Cercueil <paul@...pouillou.net>,
Emma Anholt <emma@...olt.net>,
Maxime Ripard <mripard@...nel.org>
Subject: [PATCH v2 23/26] drm: vc4: Remove #ifdef guards for PM related functions
Use the RUNTIME_PM_OPS() and pm_ptr() macros to handle the
.runtime_suspend/.runtime_resume callbacks.
These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_PM is disabled, without having
to use #ifdef guards.
This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.
Signed-off-by: Paul Cercueil <paul@...pouillou.net>
---
Cc: Emma Anholt <emma@...olt.net>
Cc: Maxime Ripard <mripard@...nel.org>
---
drivers/gpu/drm/vc4/vc4_v3d.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c
index 56abb0d6bc39..6000c7032b92 100644
--- a/drivers/gpu/drm/vc4/vc4_v3d.c
+++ b/drivers/gpu/drm/vc4/vc4_v3d.c
@@ -368,7 +368,6 @@ void vc4_v3d_bin_bo_put(struct vc4_dev *vc4)
mutex_unlock(&vc4->bin_bo_lock);
}
-#ifdef CONFIG_PM
static int vc4_v3d_runtime_suspend(struct device *dev)
{
struct vc4_v3d *v3d = dev_get_drvdata(dev);
@@ -397,7 +396,6 @@ static int vc4_v3d_runtime_resume(struct device *dev)
return 0;
}
-#endif
int vc4_v3d_debugfs_init(struct drm_minor *minor)
{
@@ -525,7 +523,7 @@ static void vc4_v3d_unbind(struct device *dev, struct device *master,
}
static const struct dev_pm_ops vc4_v3d_pm_ops = {
- SET_RUNTIME_PM_OPS(vc4_v3d_runtime_suspend, vc4_v3d_runtime_resume, NULL)
+ RUNTIME_PM_OPS(vc4_v3d_runtime_suspend, vc4_v3d_runtime_resume, NULL)
};
static const struct component_ops vc4_v3d_ops = {
@@ -557,6 +555,6 @@ struct platform_driver vc4_v3d_driver = {
.driver = {
.name = "vc4_v3d",
.of_match_table = vc4_v3d_dt_match,
- .pm = &vc4_v3d_pm_ops,
+ .pm = pm_ptr(&vc4_v3d_pm_ops),
},
};
--
2.35.1
Powered by blists - more mailing lists