summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJisheng Zhang <jszhang@kernel.org>2026-08-03 22:19:42 +0800
committerMark Brown <broonie@kernel.org>2026-08-07 18:57:56 +0100
commitaceceea2a44a6b4997ddf59a13028fa97ec87792 (patch)
tree2400462ffd4fb7b5dc2fcf919813ee8f38e96646
parent8de18aced458db42f847d0da2ae08e654ba2f6c1 (diff)
spi: meson-spifc: 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-19-jszhang@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-meson-spifc.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/spi/spi-meson-spifc.c b/drivers/spi/spi-meson-spifc.c
index e36aa94bbdae..2ef090dec7ba 100644
--- a/drivers/spi/spi-meson-spifc.c
+++ b/drivers/spi/spi-meson-spifc.c
@@ -348,7 +348,6 @@ static void meson_spifc_remove(struct platform_device *pdev)
pm_runtime_put_noidle(&pdev->dev);
}
-#ifdef CONFIG_PM_SLEEP
static int meson_spifc_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -385,9 +384,7 @@ static int meson_spifc_resume(struct device *dev)
return ret;
}
-#endif /* CONFIG_PM_SLEEP */
-#ifdef CONFIG_PM
static int meson_spifc_runtime_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -405,13 +402,12 @@ static int meson_spifc_runtime_resume(struct device *dev)
return clk_prepare_enable(spifc->clk);
}
-#endif /* CONFIG_PM */
static const struct dev_pm_ops meson_spifc_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(meson_spifc_suspend, meson_spifc_resume)
- SET_RUNTIME_PM_OPS(meson_spifc_runtime_suspend,
- meson_spifc_runtime_resume,
- NULL)
+ SYSTEM_SLEEP_PM_OPS(meson_spifc_suspend, meson_spifc_resume)
+ RUNTIME_PM_OPS(meson_spifc_runtime_suspend,
+ meson_spifc_runtime_resume,
+ NULL)
};
static const struct of_device_id meson_spifc_dt_match[] = {
@@ -427,7 +423,7 @@ static struct platform_driver meson_spifc_driver = {
.driver = {
.name = "meson-spifc",
.of_match_table = of_match_ptr(meson_spifc_dt_match),
- .pm = &meson_spifc_pm_ops,
+ .pm = pm_ptr(&meson_spifc_pm_ops),
},
};