diff options
| author | Jisheng Zhang <jszhang@kernel.org> | 2026-08-03 22:19:43 +0800 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-08-07 18:57:57 +0100 |
| commit | 06f9d950cb4c4edbb41e388fc32a0640fd5175a1 (patch) | |
| tree | 6220830a506bff9b39ef6444c120ea5d321ec689 | |
| parent | aceceea2a44a6b4997ddf59a13028fa97ec87792 (diff) | |
spi: mt65xx: use modern PM macros
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are 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: Jisheng Zhang <jszhang@kernel.org>
Link: https://patch.msgid.link/20260803142003.12857-20-jszhang@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | drivers/spi/spi-mt65xx.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index 96f8555be983..b845a599f7c6 100644 --- a/drivers/spi/spi-mt65xx.c +++ b/drivers/spi/spi-mt65xx.c @@ -1367,7 +1367,6 @@ static void mtk_spi_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int mtk_spi_suspend(struct device *dev) { int ret; @@ -1419,9 +1418,7 @@ static int mtk_spi_resume(struct device *dev) return ret; } -#endif /* CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM static int mtk_spi_runtime_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); @@ -1473,18 +1470,16 @@ static int mtk_spi_runtime_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM */ static const struct dev_pm_ops mtk_spi_pm = { - SET_SYSTEM_SLEEP_PM_OPS(mtk_spi_suspend, mtk_spi_resume) - SET_RUNTIME_PM_OPS(mtk_spi_runtime_suspend, - mtk_spi_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(mtk_spi_suspend, mtk_spi_resume) + RUNTIME_PM_OPS(mtk_spi_runtime_suspend, mtk_spi_runtime_resume, NULL) }; static struct platform_driver mtk_spi_driver = { .driver = { .name = "mtk-spi", - .pm = &mtk_spi_pm, + .pm = pm_ptr(&mtk_spi_pm), .of_match_table = mtk_spi_of_match, }, .probe = mtk_spi_probe, |
