spi: tegra20-sflash: 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-36-jszhang@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Jisheng Zhang 2026-08-03 22:19:59 +08:00 committed by Mark Brown
parent 46aec256a5
commit f4bc18af3b
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -533,7 +533,6 @@ static void tegra_sflash_remove(struct platform_device *pdev)
tegra_sflash_runtime_suspend(&pdev->dev);
}
#ifdef CONFIG_PM_SLEEP
static int tegra_sflash_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@ -557,7 +556,6 @@ static int tegra_sflash_resume(struct device *dev)
return spi_controller_resume(host);
}
#endif
static int tegra_sflash_runtime_suspend(struct device *dev)
{
@ -586,14 +584,14 @@ static int tegra_sflash_runtime_resume(struct device *dev)
}
static const struct dev_pm_ops slink_pm_ops = {
SET_RUNTIME_PM_OPS(tegra_sflash_runtime_suspend,
tegra_sflash_runtime_resume, NULL)
SET_SYSTEM_SLEEP_PM_OPS(tegra_sflash_suspend, tegra_sflash_resume)
RUNTIME_PM_OPS(tegra_sflash_runtime_suspend,
tegra_sflash_runtime_resume, NULL)
SYSTEM_SLEEP_PM_OPS(tegra_sflash_suspend, tegra_sflash_resume)
};
static struct platform_driver tegra_sflash_driver = {
.driver = {
.name = "spi-tegra-sflash",
.pm = &slink_pm_ops,
.pm = pm_ptr(&slink_pm_ops),
.of_match_table = tegra_sflash_of_match,
},
.probe = tegra_sflash_probe,