summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Moon <linux.amoon@gmail.com>2024-04-17 10:14:48 +0530
committerChanwoo Choi <cw00.choi@samsung.com>2024-05-09 00:30:37 +0900
commitccad360a2d415447bd6f0de9e873eec05442d159 (patch)
tree142cf9d8654da02e218c8de7f3485d6e7cd26389
parent8eba5b693442fcfc7bfdd6402cd191250ce3e276 (diff)
downloadlinux-ccad360a2d415447bd6f0de9e873eec05442d159.tar.gz
linux-ccad360a2d415447bd6f0de9e873eec05442d159.tar.bz2
linux-ccad360a2d415447bd6f0de9e873eec05442d159.zip
PM / devfreq: exynos: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions
This macro has the advantage over SET_SYSTEM_SLEEP_PM_OPS that we don't have to care about when the functions are actually used. Also make use of pm_sleep_ptr() to discard all PM_SLEEP related stuff if CONFIG_PM_SLEEP isn't enabled. Link: https://lore.kernel.org/lkml/20240417044459.1908-2-linux.amoon@gmail.com/ Signed-off-by: Anand Moon <linux.amoon@gmail.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
-rw-r--r--drivers/devfreq/exynos-bus.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
index 245898f1a88e..00118580905a 100644
--- a/drivers/devfreq/exynos-bus.c
+++ b/drivers/devfreq/exynos-bus.c
@@ -467,7 +467,6 @@ static void exynos_bus_shutdown(struct platform_device *pdev)
devfreq_suspend_device(bus->devfreq);
}
-#ifdef CONFIG_PM_SLEEP
static int exynos_bus_resume(struct device *dev)
{
struct exynos_bus *bus = dev_get_drvdata(dev);
@@ -495,11 +494,9 @@ static int exynos_bus_suspend(struct device *dev)
return 0;
}
-#endif
-static const struct dev_pm_ops exynos_bus_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(exynos_bus_suspend, exynos_bus_resume)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(exynos_bus_pm,
+ exynos_bus_suspend, exynos_bus_resume);
static const struct of_device_id exynos_bus_of_match[] = {
{ .compatible = "samsung,exynos-bus", },
@@ -512,7 +509,7 @@ static struct platform_driver exynos_bus_platdrv = {
.shutdown = exynos_bus_shutdown,
.driver = {
.name = "exynos-bus",
- .pm = &exynos_bus_pm,
+ .pm = pm_sleep_ptr(&exynos_bus_pm),
.of_match_table = exynos_bus_of_match,
},
};