[PATCH 34/39] spi: tegra114: use modern PM macros

From: Jisheng Zhang

Date: Mon Aug 03 2026 - 11:11:27 EST


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@xxxxxxxxxx>
---
drivers/spi/spi-tegra114.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index aa44ffd09e61..333fb549214e 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -1450,7 +1450,6 @@ static void tegra_spi_remove(struct platform_device *pdev)
tegra_spi_runtime_suspend(&pdev->dev);
}

-#ifdef CONFIG_PM_SLEEP
static int tegra_spi_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -1476,7 +1475,6 @@ static int tegra_spi_resume(struct device *dev)

return spi_controller_resume(host);
}
-#endif

static int tegra_spi_runtime_suspend(struct device *dev)
{
@@ -1505,14 +1503,14 @@ static int tegra_spi_runtime_resume(struct device *dev)
}

static const struct dev_pm_ops tegra_spi_pm_ops = {
- SET_RUNTIME_PM_OPS(tegra_spi_runtime_suspend,
- tegra_spi_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(tegra_spi_suspend, tegra_spi_resume)
+ RUNTIME_PM_OPS(tegra_spi_runtime_suspend,
+ tegra_spi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(tegra_spi_suspend, tegra_spi_resume)
};
static struct platform_driver tegra_spi_driver = {
.driver = {
.name = "spi-tegra114",
- .pm = &tegra_spi_pm_ops,
+ .pm = pm_ptr(&tegra_spi_pm_ops),
.of_match_table = tegra_spi_of_match,
},
.probe = tegra_spi_probe,
--
2.53.0