Skip to content

Commit 02774b1

Browse files
Fabio Estevambroonie
authored andcommitted
spi: mxs: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()
Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives. The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the __maybe_unused annotations from the suspend/resume() functions. Signed-off-by: Fabio Estevam <festevam@denx.de> Link: https://patch.msgid.link/20240902184655.932699-1-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent bf62a8c commit 02774b1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/spi/spi-mxs.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static int mxs_spi_runtime_resume(struct device *dev)
477477
return ret;
478478
}
479479

480-
static int __maybe_unused mxs_spi_suspend(struct device *dev)
480+
static int mxs_spi_suspend(struct device *dev)
481481
{
482482
struct spi_controller *host = dev_get_drvdata(dev);
483483
int ret;
@@ -492,7 +492,7 @@ static int __maybe_unused mxs_spi_suspend(struct device *dev)
492492
return 0;
493493
}
494494

495-
static int __maybe_unused mxs_spi_resume(struct device *dev)
495+
static int mxs_spi_resume(struct device *dev)
496496
{
497497
struct spi_controller *host = dev_get_drvdata(dev);
498498
int ret;
@@ -512,9 +512,8 @@ static int __maybe_unused mxs_spi_resume(struct device *dev)
512512
}
513513

514514
static const struct dev_pm_ops mxs_spi_pm = {
515-
SET_RUNTIME_PM_OPS(mxs_spi_runtime_suspend,
516-
mxs_spi_runtime_resume, NULL)
517-
SET_SYSTEM_SLEEP_PM_OPS(mxs_spi_suspend, mxs_spi_resume)
515+
RUNTIME_PM_OPS(mxs_spi_runtime_suspend, mxs_spi_runtime_resume, NULL)
516+
SYSTEM_SLEEP_PM_OPS(mxs_spi_suspend, mxs_spi_resume)
518517
};
519518

520519
static const struct of_device_id mxs_spi_dt_ids[] = {
@@ -662,7 +661,7 @@ static struct platform_driver mxs_spi_driver = {
662661
.driver = {
663662
.name = DRIVER_NAME,
664663
.of_match_table = mxs_spi_dt_ids,
665-
.pm = &mxs_spi_pm,
664+
.pm = pm_ptr(&mxs_spi_pm),
666665
},
667666
};
668667

0 commit comments

Comments
 (0)