Skip to content

Commit ccad360

Browse files
moonlinuxchanwoochoi
authored andcommitted
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/[email protected]/ Signed-off-by: Anand Moon <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent 8eba5b6 commit ccad360

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/devfreq/exynos-bus.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,6 @@ static void exynos_bus_shutdown(struct platform_device *pdev)
467467
devfreq_suspend_device(bus->devfreq);
468468
}
469469

470-
#ifdef CONFIG_PM_SLEEP
471470
static int exynos_bus_resume(struct device *dev)
472471
{
473472
struct exynos_bus *bus = dev_get_drvdata(dev);
@@ -495,11 +494,9 @@ static int exynos_bus_suspend(struct device *dev)
495494

496495
return 0;
497496
}
498-
#endif
499497

500-
static const struct dev_pm_ops exynos_bus_pm = {
501-
SET_SYSTEM_SLEEP_PM_OPS(exynos_bus_suspend, exynos_bus_resume)
502-
};
498+
static DEFINE_SIMPLE_DEV_PM_OPS(exynos_bus_pm,
499+
exynos_bus_suspend, exynos_bus_resume);
503500

504501
static const struct of_device_id exynos_bus_of_match[] = {
505502
{ .compatible = "samsung,exynos-bus", },
@@ -512,7 +509,7 @@ static struct platform_driver exynos_bus_platdrv = {
512509
.shutdown = exynos_bus_shutdown,
513510
.driver = {
514511
.name = "exynos-bus",
515-
.pm = &exynos_bus_pm,
512+
.pm = pm_sleep_ptr(&exynos_bus_pm),
516513
.of_match_table = exynos_bus_of_match,
517514
},
518515
};

0 commit comments

Comments
 (0)