public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] More CONFIG_PM* simplifications
@ 2026-01-19 12:34 Bastien Nocera
  2026-01-19 12:34 ` [PATCH v3 1/2] Bluetooth: btnxpuart: Remove unneeded CONFIG_PM ifdef Bastien Nocera
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Bastien Nocera @ 2026-01-19 12:34 UTC (permalink / raw)
  To: linux-bluetooth

Follow-up from the earlier "Bluetooth: btusb: Use pm_ptr instead of
#ifdef CONFIG_PM" patch.

Both drivers were successfully compiled with CONFIG_PM disabled.

Changes since v2:
- Drop btmtksdio.c changes, there's a fix in bluetooth-next

Changes since v1:
- Fix "defined but not used" warnings reported by the kernel test robot
- Modify commit messages following review comments

Bastien Nocera (2):
  Bluetooth: btnxpuart: Remove unneeded CONFIG_PM ifdef
  Bluetooth: btintel: Remove unneeded CONFIG_PM* #ifdef's

 drivers/bluetooth/btnxpuart.c |  6 ++----
 drivers/bluetooth/hci_intel.c | 10 ++--------
 2 files changed, 4 insertions(+), 12 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH v2 1/3] Bluetooth: btmtksdio: Simplify dev_pm_ops usage
@ 2026-01-19 10:27 Bastien Nocera
  2026-01-19 10:56 ` More CONFIG_PM* simplifications bluez.test.bot
  0 siblings, 1 reply; 9+ messages in thread
From: Bastien Nocera @ 2026-01-19 10:27 UTC (permalink / raw)
  To: linux-bluetooth

This increases build coverage and allows to drop a few #ifdef's.

SET_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS() become no-ops if
CONFIG_PM_SLEEP or CONFIG_PM are disabled.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/bluetooth/btmtksdio.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
index fba3ab6d30a5..3f941081ae6b 100644
--- a/drivers/bluetooth/btmtksdio.c
+++ b/drivers/bluetooth/btmtksdio.c
@@ -1472,7 +1472,6 @@ static void btmtksdio_remove(struct sdio_func *func)
 	hci_free_dev(hdev);
 }
 
-#ifdef CONFIG_PM
 static int btmtksdio_runtime_suspend(struct device *dev)
 {
 	struct sdio_func *func = dev_to_sdio_func(dev);
@@ -1495,7 +1494,7 @@ static int btmtksdio_runtime_suspend(struct device *dev)
 	return err;
 }
 
-static int btmtksdio_system_suspend(struct device *dev)
+static int __maybe_unused btmtksdio_system_suspend(struct device *dev)
 {
 	struct sdio_func *func = dev_to_sdio_func(dev);
 	struct btmtksdio_dev *bdev;
@@ -1532,28 +1531,23 @@ static int btmtksdio_runtime_resume(struct device *dev)
 	return err;
 }
 
-static int btmtksdio_system_resume(struct device *dev)
+static int __maybe_unused btmtksdio_system_resume(struct device *dev)
 {
 	return btmtksdio_runtime_resume(dev);
 }
 
 static const struct dev_pm_ops btmtksdio_pm_ops = {
-	SYSTEM_SLEEP_PM_OPS(btmtksdio_system_suspend, btmtksdio_system_resume)
-	RUNTIME_PM_OPS(btmtksdio_runtime_suspend, btmtksdio_runtime_resume, NULL)
+	SET_SYSTEM_SLEEP_PM_OPS(btmtksdio_system_suspend, btmtksdio_system_resume)
+	SET_RUNTIME_PM_OPS(btmtksdio_runtime_suspend, btmtksdio_runtime_resume, NULL)
 };
 
-#define BTMTKSDIO_PM_OPS (&btmtksdio_pm_ops)
-#else	/* CONFIG_PM */
-#define BTMTKSDIO_PM_OPS NULL
-#endif	/* CONFIG_PM */
-
 static struct sdio_driver btmtksdio_driver = {
 	.name		= "btmtksdio",
 	.probe		= btmtksdio_probe,
 	.remove		= btmtksdio_remove,
 	.id_table	= btmtksdio_table,
 	.drv = {
-		.pm = BTMTKSDIO_PM_OPS,
+		.pm = &btmtksdio_pm_ops,
 	}
 };
 
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH 1/3] Bluetooth: btmtksdio: Simplify dev_pm_ops usage
@ 2026-01-16 12:50 Bastien Nocera
  2026-01-16 13:36 ` More CONFIG_PM* simplifications bluez.test.bot
  0 siblings, 1 reply; 9+ messages in thread
From: Bastien Nocera @ 2026-01-16 12:50 UTC (permalink / raw)
  To: linux-bluetooth

This increases build coverage and allows to drop a few #ifdef's.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/bluetooth/btmtksdio.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
index fba3ab6d30a5..ec17521d5b9f 100644
--- a/drivers/bluetooth/btmtksdio.c
+++ b/drivers/bluetooth/btmtksdio.c
@@ -1472,7 +1472,6 @@ static void btmtksdio_remove(struct sdio_func *func)
 	hci_free_dev(hdev);
 }
 
-#ifdef CONFIG_PM
 static int btmtksdio_runtime_suspend(struct device *dev)
 {
 	struct sdio_func *func = dev_to_sdio_func(dev);
@@ -1538,22 +1537,17 @@ static int btmtksdio_system_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops btmtksdio_pm_ops = {
-	SYSTEM_SLEEP_PM_OPS(btmtksdio_system_suspend, btmtksdio_system_resume)
-	RUNTIME_PM_OPS(btmtksdio_runtime_suspend, btmtksdio_runtime_resume, NULL)
+	SET_SYSTEM_SLEEP_PM_OPS(btmtksdio_system_suspend, btmtksdio_system_resume)
+	SET_RUNTIME_PM_OPS(btmtksdio_runtime_suspend, btmtksdio_runtime_resume, NULL)
 };
 
-#define BTMTKSDIO_PM_OPS (&btmtksdio_pm_ops)
-#else	/* CONFIG_PM */
-#define BTMTKSDIO_PM_OPS NULL
-#endif	/* CONFIG_PM */
-
 static struct sdio_driver btmtksdio_driver = {
 	.name		= "btmtksdio",
 	.probe		= btmtksdio_probe,
 	.remove		= btmtksdio_remove,
 	.id_table	= btmtksdio_table,
 	.drv = {
-		.pm = BTMTKSDIO_PM_OPS,
+		.pm = &btmtksdio_pm_ops,
 	}
 };
 
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-01-20 18:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-19 12:34 [PATCH v3 0/2] More CONFIG_PM* simplifications Bastien Nocera
2026-01-19 12:34 ` [PATCH v3 1/2] Bluetooth: btnxpuart: Remove unneeded CONFIG_PM ifdef Bastien Nocera
2026-01-19 14:02   ` More CONFIG_PM* simplifications bluez.test.bot
2026-01-20  6:40   ` [PATCH v3 1/2] Bluetooth: btnxpuart: Remove unneeded CONFIG_PM ifdef Neeraj Sanjay Kale
2026-01-19 12:35 ` [PATCH v3 2/2] Bluetooth: btintel: Remove unneeded CONFIG_PM* #ifdef's Bastien Nocera
2026-01-20 18:20 ` [PATCH v3 0/2] More CONFIG_PM* simplifications patchwork-bot+bluetooth
  -- strict thread matches above, loose matches on Subject: below --
2026-01-19 10:27 [PATCH v2 1/3] Bluetooth: btmtksdio: Simplify dev_pm_ops usage Bastien Nocera
2026-01-19 10:56 ` More CONFIG_PM* simplifications bluez.test.bot
2026-01-19 11:47   ` Bastien Nocera
2026-01-16 12:50 [PATCH 1/3] Bluetooth: btmtksdio: Simplify dev_pm_ops usage Bastien Nocera
2026-01-16 13:36 ` More CONFIG_PM* simplifications bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox