Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Anand Moon and committed by
Chanwoo Choi
ccad360a 8eba5b69

+3 -6
+3 -6
drivers/devfreq/exynos-bus.c
··· 467 467 devfreq_suspend_device(bus->devfreq); 468 468 } 469 469 470 - #ifdef CONFIG_PM_SLEEP 471 470 static int exynos_bus_resume(struct device *dev) 472 471 { 473 472 struct exynos_bus *bus = dev_get_drvdata(dev); ··· 494 495 495 496 return 0; 496 497 } 497 - #endif 498 498 499 - static const struct dev_pm_ops exynos_bus_pm = { 500 - SET_SYSTEM_SLEEP_PM_OPS(exynos_bus_suspend, exynos_bus_resume) 501 - }; 499 + static DEFINE_SIMPLE_DEV_PM_OPS(exynos_bus_pm, 500 + exynos_bus_suspend, exynos_bus_resume); 502 501 503 502 static const struct of_device_id exynos_bus_of_match[] = { 504 503 { .compatible = "samsung,exynos-bus", }, ··· 509 512 .shutdown = exynos_bus_shutdown, 510 513 .driver = { 511 514 .name = "exynos-bus", 512 - .pm = &exynos_bus_pm, 515 + .pm = pm_sleep_ptr(&exynos_bus_pm), 513 516 .of_match_table = exynos_bus_of_match, 514 517 }, 515 518 };