public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] More CONFIG_PM* simplifications
@ 2026-01-19 10:27 Bastien Nocera
  2026-01-19 10:27 ` [PATCH v2 1/3] Bluetooth: btmtksdio: Simplify dev_pm_ops usage Bastien Nocera
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Bastien Nocera @ 2026-01-19 10:27 UTC (permalink / raw)
  To: linux-bluetooth

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

All 3 drivers were successfully compiled with CONFIG_PM disabled.

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

Bastien Nocera (3):
  Bluetooth: btmtksdio: Simplify dev_pm_ops usage
  Bluetooth: btnxpuart: Remove unneeded CONFIG_PM ifdef
  Bluetooth: btintel: Remove unneeded CONFIG_PM* #ifdef's

 drivers/bluetooth/btmtksdio.c | 16 +++++-----------
 drivers/bluetooth/btnxpuart.c |  6 ++----
 drivers/bluetooth/hci_intel.c | 10 ++--------
 3 files changed, 9 insertions(+), 23 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH v3 1/2] Bluetooth: btnxpuart: Remove unneeded CONFIG_PM ifdef
@ 2026-01-19 12:34 Bastien Nocera
  2026-01-19 14:02 ` More CONFIG_PM* simplifications bluez.test.bot
  0 siblings, 1 reply; 8+ messages in thread
From: Bastien Nocera @ 2026-01-19 12:34 UTC (permalink / raw)
  To: linux-bluetooth

The functions are already disabled through the use of pm_ptr() when
CONFIG_PM is disabled, and will be removed from the final linked code
as not needed.

This increases build coverage and allows to drop an #ifdef.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/bluetooth/btnxpuart.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
index 3b1e9224e965..e7036a48ce48 100644
--- a/drivers/bluetooth/btnxpuart.c
+++ b/drivers/bluetooth/btnxpuart.c
@@ -1947,8 +1947,7 @@ static void nxp_serdev_remove(struct serdev_device *serdev)
 	hci_free_dev(hdev);
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int nxp_serdev_suspend(struct device *dev)
+static int __maybe_unused nxp_serdev_suspend(struct device *dev)
 {
 	struct btnxpuart_dev *nxpdev = dev_get_drvdata(dev);
 	struct ps_data *psdata = &nxpdev->psdata;
@@ -1962,7 +1961,7 @@ static int nxp_serdev_suspend(struct device *dev)
 	return 0;
 }
 
-static int nxp_serdev_resume(struct device *dev)
+static int __maybe_unused nxp_serdev_resume(struct device *dev)
 {
 	struct btnxpuart_dev *nxpdev = dev_get_drvdata(dev);
 	struct ps_data *psdata = &nxpdev->psdata;
@@ -1975,7 +1974,6 @@ static int nxp_serdev_resume(struct device *dev)
 	ps_control(psdata->hdev, PS_STATE_AWAKE);
 	return 0;
 }
-#endif
 
 #ifdef CONFIG_DEV_COREDUMP
 static void nxp_serdev_coredump(struct device *dev)
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 8+ 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; 8+ 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] 8+ messages in thread

end of thread, other threads:[~2026-01-19 14:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-19 10:27 [PATCH v2 0/3] More CONFIG_PM* simplifications Bastien Nocera
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-19 10:27 ` [PATCH v2 2/3] Bluetooth: btnxpuart: Remove unneeded CONFIG_PM ifdef Bastien Nocera
2026-01-19 10:27 ` [PATCH v2 3/3] Bluetooth: btintel: Remove unneeded CONFIG_PM* #ifdef's Bastien Nocera
  -- strict thread matches above, loose matches on Subject: below --
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-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