public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] More CONFIG_PM* simplifications
@ 2026-01-16 12:50 Bastien Nocera
  2026-01-16 12:50 ` [PATCH 1/3] Bluetooth: btmtksdio: Simplify dev_pm_ops usage Bastien Nocera
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Bastien Nocera @ 2026-01-16 12:50 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.

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 | 12 +++---------
 drivers/bluetooth/btnxpuart.c |  2 --
 drivers/bluetooth/hci_intel.c |  6 ------
 3 files changed, 3 insertions(+), 17 deletions(-)

-- 
2.52.0


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

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

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-16 12:50 [PATCH 0/3] More CONFIG_PM* simplifications Bastien Nocera
2026-01-16 12:50 ` [PATCH 1/3] Bluetooth: btmtksdio: Simplify dev_pm_ops usage Bastien Nocera
2026-01-16 13:33   ` Paul Menzel
2026-01-16 13:42     ` Bastien Nocera
2026-01-16 13:36   ` More CONFIG_PM* simplifications bluez.test.bot
2026-01-16 19:29   ` [PATCH 1/3] Bluetooth: btmtksdio: Simplify dev_pm_ops usage kernel test robot
2026-01-16 12:50 ` [PATCH 2/3] Bluetooth: btnxpuart: Remove unneeded CONFIG_PM ifdef Bastien Nocera
2026-01-16 13:35   ` Paul Menzel
2026-01-16 14:35   ` Luiz Augusto von Dentz
2026-01-16 14:41     ` Bastien Nocera
2026-01-16 19:50   ` kernel test robot
2026-01-19  7:53     ` Neeraj Sanjay Kale
2026-01-19  9:10       ` Bastien Nocera
2026-01-20 16:42         ` Luiz Augusto von Dentz
2026-01-20 17:17           ` Bastien Nocera
2026-01-20 18:05             ` Luiz Augusto von Dentz
2026-01-20 21:38               ` Bastien Nocera
2026-01-16 12:50 ` [PATCH 3/3] Bluetooth: btintel: Remove unneeded CONFIG_PM* #ifdef's Bastien Nocera
2026-01-16 13:36   ` Paul Menzel
2026-01-16 21:49   ` kernel test robot
  -- 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-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

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