summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJisheng Zhang <jszhang@kernel.org>2026-08-03 22:19:31 +0800
committerMark Brown <broonie@kernel.org>2026-08-07 18:57:46 +0100
commitf95bf30ed173ab16156c68dbe23859d64d0f657e (patch)
tree7cbd485bda13dd5ce5debf47d99c3c674fcb4f98
parent408ba1d06ee1c0e413ed841532074222e82621f2 (diff)
spi: bcmbca-hsspi: 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> Acked-by: William Zhang <william.zhang@broadcom.com> Link: https://patch.msgid.link/20260803142003.12857-8-jszhang@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-bcmbca-hsspi.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/spi/spi-bcmbca-hsspi.c b/drivers/spi/spi-bcmbca-hsspi.c
index af88ce04948b..b019f3ff3547 100644
--- a/drivers/spi/spi-bcmbca-hsspi.c
+++ b/drivers/spi/spi-bcmbca-hsspi.c
@@ -563,7 +563,6 @@ static void bcmbca_hsspi_remove(struct platform_device *pdev)
sysfs_remove_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
}
-#ifdef CONFIG_PM_SLEEP
static int bcmbca_hsspi_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -602,10 +601,9 @@ static int bcmbca_hsspi_resume(struct device *dev)
return 0;
}
-#endif
-static SIMPLE_DEV_PM_OPS(bcmbca_hsspi_pm_ops, bcmbca_hsspi_suspend,
- bcmbca_hsspi_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(bcmbca_hsspi_pm_ops, bcmbca_hsspi_suspend,
+ bcmbca_hsspi_resume);
static const struct of_device_id bcmbca_hsspi_of_match[] = {
{ .compatible = "brcm,bcmbca-hsspi-v1.1", },
@@ -617,7 +615,7 @@ MODULE_DEVICE_TABLE(of, bcmbca_hsspi_of_match);
static struct platform_driver bcmbca_hsspi_driver = {
.driver = {
.name = "bcmbca-hsspi",
- .pm = &bcmbca_hsspi_pm_ops,
+ .pm = pm_sleep_ptr(&bcmbca_hsspi_pm_ops),
.of_match_table = bcmbca_hsspi_of_match,
},
.probe = bcmbca_hsspi_probe,