Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v6] Bluetooth: pm: use DEFINE_SIMPLE_DEV_OPS for pm struct
@ 2026-08-31  1:46 Li Jun
  2026-08-31  6:26 ` [v6] " bluez.test.bot
  2026-08-31 15:57 ` [PATCH v6] " Luiz Augusto von Dentz
  0 siblings, 2 replies; 3+ messages in thread
From: Li Jun @ 2026-08-31  1:46 UTC (permalink / raw)
  To: lijun01, marcel, luiz.dentz, linux-bluetooth

use DEFINE_SIMPLE_DEV_PM_OPS for btmrvl_sdio_pm_ops, and add the value of
'.freeze, .thaw, .poweroff, .restore'. if these address are null,
may cause error in s4. pm_sleep_ptr() to safely drop the references without
triggering compiler warnings. This macro automatically handles
CONFIG_PM_SLEEP configuration and generates freeze/thaw/poweroff/restore
callbacks, reducing boilerplate code.

Signed-off-by: Li Jun <lijun01@kylinos.cn>
---
Changes:
-Corrected grammar and spell errors in comment.
-Replace SIMPLE_DEV_OPS with DEFINE_SIMPLE_DEV_OPS.
-Add a description of pm_sleep_ptr().
-Add pm_sleep_ptr(&btmrvl_sdio_pm_ops) for bt_mrvl_sdio struct.
---
 drivers/bluetooth/btmrvl_sdio.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c
index b91fc63bc9fe..a250a83a031d 100644
--- a/drivers/bluetooth/btmrvl_sdio.c
+++ b/drivers/bluetooth/btmrvl_sdio.c
@@ -1726,10 +1726,7 @@ static int btmrvl_sdio_resume(struct device *dev)
 	return 0;
 }
 
-static const struct dev_pm_ops btmrvl_sdio_pm_ops = {
-	.suspend	= btmrvl_sdio_suspend,
-	.resume		= btmrvl_sdio_resume,
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(btmrvl_sdio_pm_ops, btmrvl_sdio_suspend, btmrvl_sdio_resume);
 
 static struct sdio_driver bt_mrvl_sdio = {
 	.name		= "btmrvl_sdio",
@@ -1738,7 +1735,7 @@ static struct sdio_driver bt_mrvl_sdio = {
 	.remove		= btmrvl_sdio_remove,
 	.drv = {
 		.coredump = btmrvl_sdio_coredump,
-		.pm = &btmrvl_sdio_pm_ops,
+		.pm = pm_sleep_ptr(&btmrvl_sdio_pm_ops),
 	}
 };
 
-- 
2.25.1


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

* RE: [v6] Bluetooth: pm: use DEFINE_SIMPLE_DEV_OPS for pm struct
  2026-08-31  1:46 [PATCH v6] Bluetooth: pm: use DEFINE_SIMPLE_DEV_OPS for pm struct Li Jun
@ 2026-08-31  6:26 ` bluez.test.bot
  2026-08-31 15:57 ` [PATCH v6] " Luiz Augusto von Dentz
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-08-31  6:26 UTC (permalink / raw)
  To: linux-bluetooth, lijun01

[-- Attachment #1: Type: text/plain, Size: 1181 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1154034

---Test result---

Test Summary:
CheckPatch                    PASS      0.73 seconds
VerifyFixes                   PASS      0.13 seconds
VerifySignedoff               PASS      0.13 seconds
GitLint                       PASS      0.33 seconds
SubjectPrefix                 PASS      0.12 seconds
BuildKernel                   PASS      26.72 seconds
CheckAllWarning               PASS      29.43 seconds
CheckSparse                   PASS      27.99 seconds
BuildKernel32                 PASS      25.90 seconds
CheckKernelLLVM               SKIP      0.00 seconds
TestRunnerSetup               PASS      469.40 seconds
IncrementalBuild              PASS      24.71 seconds

Details
##############################
Test: CheckKernelLLVM - SKIP
Desc: Build kernel with LLVM + context analysis
Output:
Clang not found


https://github.com/bluez/bluetooth-next/pull/669

---
Regards,
Linux Bluetooth


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

* Re: [PATCH v6] Bluetooth: pm: use DEFINE_SIMPLE_DEV_OPS for pm struct
  2026-08-31  1:46 [PATCH v6] Bluetooth: pm: use DEFINE_SIMPLE_DEV_OPS for pm struct Li Jun
  2026-08-31  6:26 ` [v6] " bluez.test.bot
@ 2026-08-31 15:57 ` Luiz Augusto von Dentz
  1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2026-08-31 15:57 UTC (permalink / raw)
  To: Li Jun; +Cc: marcel, linux-bluetooth

Hi,

On Sun, Aug 30, 2026 at 9:47 PM Li Jun <lijun01@kylinos.cn> wrote:
>
> use DEFINE_SIMPLE_DEV_PM_OPS for btmrvl_sdio_pm_ops, and add the value of
> '.freeze, .thaw, .poweroff, .restore'. if these address are null,
> may cause error in s4. pm_sleep_ptr() to safely drop the references without
> triggering compiler warnings. This macro automatically handles
> CONFIG_PM_SLEEP configuration and generates freeze/thaw/poweroff/restore
> callbacks, reducing boilerplate code.
>
> Signed-off-by: Li Jun <lijun01@kylinos.cn>
> ---
> Changes:
> -Corrected grammar and spell errors in comment.
> -Replace SIMPLE_DEV_OPS with DEFINE_SIMPLE_DEV_OPS.
> -Add a description of pm_sleep_ptr().
> -Add pm_sleep_ptr(&btmrvl_sdio_pm_ops) for bt_mrvl_sdio struct.
> ---
>  drivers/bluetooth/btmrvl_sdio.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c
> index b91fc63bc9fe..a250a83a031d 100644
> --- a/drivers/bluetooth/btmrvl_sdio.c
> +++ b/drivers/bluetooth/btmrvl_sdio.c
> @@ -1726,10 +1726,7 @@ static int btmrvl_sdio_resume(struct device *dev)
>         return 0;
>  }
>
> -static const struct dev_pm_ops btmrvl_sdio_pm_ops = {
> -       .suspend        = btmrvl_sdio_suspend,
> -       .resume         = btmrvl_sdio_resume,
> -};
> +static DEFINE_SIMPLE_DEV_PM_OPS(btmrvl_sdio_pm_ops, btmrvl_sdio_suspend, btmrvl_sdio_resume);
>
>  static struct sdio_driver bt_mrvl_sdio = {
>         .name           = "btmrvl_sdio",
> @@ -1738,7 +1735,7 @@ static struct sdio_driver bt_mrvl_sdio = {
>         .remove         = btmrvl_sdio_remove,
>         .drv = {
>                 .coredump = btmrvl_sdio_coredump,
> -               .pm = &btmrvl_sdio_pm_ops,
> +               .pm = pm_sleep_ptr(&btmrvl_sdio_pm_ops),
>         }
>  };
>
> --
> 2.25.1

I hope you are checking the feedback Sashiko provided:

https://sashiko.dev/#/patchset/20260831014638.123808-1-lijun01%40kylinos.cn

-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2026-08-31 15:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31  1:46 [PATCH v6] Bluetooth: pm: use DEFINE_SIMPLE_DEV_OPS for pm struct Li Jun
2026-08-31  6:26 ` [v6] " bluez.test.bot
2026-08-31 15:57 ` [PATCH v6] " Luiz Augusto von Dentz

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