[PATCH v2] wifi: ath10k: sdio: Use pm_sleep_ptr instead of #ifdef CONFIG_PM_SLEEP

Uwe Kleine-König u.kleine-koenig at baylibre.com
Fri Dec 19 09:32:18 PST 2025


This increases build coverage and removes an ugly #ifdef block.

To prevent "defined but not used" warnings use
DEFINE_SIMPLE_DEV_PM_OPS() instead of the deprecated
SIMPLE_DEV_PM_OPS().

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at baylibre.com>
---
Changes since (implicit) v1: Switch to DEFINE_SIMPLE_DEV_PM_OPS() to
prevent warnings. Thanks to Baochen Qiang for the hint.

 drivers/net/wireless/ath/ath10k/sdio.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c
index c06d50db40b8..2e58fb1d2ca3 100644
--- a/drivers/net/wireless/ath/ath10k/sdio.c
+++ b/drivers/net/wireless/ath/ath10k/sdio.c
@@ -2136,8 +2136,6 @@ static const struct ath10k_hif_ops ath10k_sdio_hif_ops = {
 #endif
 };
 
-#ifdef CONFIG_PM_SLEEP
-
 /* Empty handlers so that mmc subsystem doesn't remove us entirely during
  * suspend. We instead follow cfg80211 suspend/resume handlers.
  */
@@ -2172,16 +2170,8 @@ static int ath10k_sdio_pm_resume(struct device *device)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(ath10k_sdio_pm_ops, ath10k_sdio_pm_suspend,
-			 ath10k_sdio_pm_resume);
-
-#define ATH10K_SDIO_PM_OPS (&ath10k_sdio_pm_ops)
-
-#else
-
-#define ATH10K_SDIO_PM_OPS NULL
-
-#endif /* CONFIG_PM_SLEEP */
+static DEFINE_SIMPLE_DEV_PM_OPS(ath10k_sdio_pm_ops, ath10k_sdio_pm_suspend,
+				ath10k_sdio_pm_resume);
 
 static int ath10k_sdio_napi_poll(struct napi_struct *ctx, int budget)
 {
@@ -2668,7 +2658,7 @@ static struct sdio_driver ath10k_sdio_driver = {
 	.probe = ath10k_sdio_probe,
 	.remove = ath10k_sdio_remove,
 	.drv = {
-		.pm = ATH10K_SDIO_PM_OPS,
+		.pm = pm_sleep_ptr(&ath10k_sdio_pm_ops),
 	},
 };
 module_sdio_driver(ath10k_sdio_driver);

base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
-- 
2.47.3




More information about the ath10k mailing list