mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 14:33:24 -04:00
spi: mxic: 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 __maybe_unused. Signed-off-by: Jisheng Zhang <jszhang@kernel.org> Link: https://patch.msgid.link/20260803142003.12857-22-jszhang@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
fcb6a6e73e
commit
169d9f0fd9
@@ -721,7 +721,7 @@ static int mxic_spi_mem_ecc_probe(struct platform_device *pdev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused mxic_spi_runtime_suspend(struct device *dev)
|
||||
static int mxic_spi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
struct mxic_spi *mxic = spi_controller_get_devdata(host);
|
||||
@@ -732,7 +732,7 @@ static int __maybe_unused mxic_spi_runtime_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused mxic_spi_runtime_resume(struct device *dev)
|
||||
static int mxic_spi_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
struct mxic_spi *mxic = spi_controller_get_devdata(host);
|
||||
@@ -748,8 +748,7 @@ static int __maybe_unused mxic_spi_runtime_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops mxic_spi_dev_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(mxic_spi_runtime_suspend,
|
||||
mxic_spi_runtime_resume, NULL)
|
||||
RUNTIME_PM_OPS(mxic_spi_runtime_suspend, mxic_spi_runtime_resume, NULL)
|
||||
};
|
||||
|
||||
static int mxic_spi_probe(struct platform_device *pdev)
|
||||
@@ -850,7 +849,7 @@ static struct platform_driver mxic_spi_driver = {
|
||||
.driver = {
|
||||
.name = "mxic-spi",
|
||||
.of_match_table = mxic_spi_of_ids,
|
||||
.pm = &mxic_spi_dev_pm_ops,
|
||||
.pm = pm_ptr(&mxic_spi_dev_pm_ops),
|
||||
},
|
||||
};
|
||||
module_platform_driver(mxic_spi_driver);
|
||||
|
||||
Reference in New Issue
Block a user