Linux ATA/IDE development
 help / color / mirror / Atom feed
* [PATCH v5] ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS
@ 2026-09-08  9:49 Li Jun
  2026-09-08 11:36 ` Niklas Cassel
  0 siblings, 1 reply; 3+ messages in thread
From: Li Jun @ 2026-09-08  9:49 UTC (permalink / raw)
  To: lijun01, dlemoal, cassel, linux-ide

Replace the deprecated SIMPLE_DEV_PM_OPS macro with the recommended
DEFINE_SIMPLE_DEV_PM_OPS. Use pm_ptr(&ahci_da850_pm_ops) to complete
the API migration and allow the structure to be correctly dropped
when CONFIG_PM=n.

Signed-off-by: Li Jun <lijun01@kylinos.cn>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
---
changelogs:
-add pm_ptr for ahci_da850_pm_ops in ahci_da850_driver.
-revise grammar and alignment issues.
-Align parentheses.
-change pm_ptr to pm_sleep_ptr.
---
 drivers/ata/ahci_da850.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c
index 4e53ff96d712..59b9ca26fd44 100644
--- a/drivers/ata/ahci_da850.c
+++ b/drivers/ata/ahci_da850.c
@@ -218,8 +218,8 @@ static int ahci_da850_probe(struct platform_device *pdev)
 	return rc;
 }
 
-static SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, ahci_platform_suspend,
-			 ahci_platform_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, ahci_platform_suspend,
+				ahci_platform_resume);
 
 static const struct of_device_id ahci_da850_of_match[] = {
 	{ .compatible = "ti,da850-ahci", },
@@ -233,7 +233,7 @@ static struct platform_driver ahci_da850_driver = {
 	.driver = {
 		.name = DRV_NAME,
 		.of_match_table = ahci_da850_of_match,
-		.pm = &ahci_da850_pm_ops,
+		.pm = pm_sleep_ptr(&ahci_da850_pm_ops),
 	},
 };
 module_platform_driver(ahci_da850_driver);
-- 
2.25.1


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

* Re: [PATCH v5] ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS
  2026-09-08  9:49 [PATCH v5] ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS Li Jun
@ 2026-09-08 11:36 ` Niklas Cassel
  2026-09-08 11:43   ` Niklas Cassel
  0 siblings, 1 reply; 3+ messages in thread
From: Niklas Cassel @ 2026-09-08 11:36 UTC (permalink / raw)
  To: dlemoal, linux-ide, Li Jun; +Cc: Niklas Cassel

On Tue, 08 Sep 2026 17:49:01 +0800, Li Jun wrote:
> Replace the deprecated SIMPLE_DEV_PM_OPS macro with the recommended
> DEFINE_SIMPLE_DEV_PM_OPS. Use pm_ptr(&ahci_da850_pm_ops) to complete
> the API migration and allow the structure to be correctly dropped
> when CONFIG_PM=n.
> 
> 

Applied to libata/linux.git (for-7.4), thanks!

[1/1] ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS
      https://git.kernel.org/libata/linux/c/2ce5b29b

Kind regards,
Niklas

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

* Re: [PATCH v5] ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS
  2026-09-08 11:36 ` Niklas Cassel
@ 2026-09-08 11:43   ` Niklas Cassel
  0 siblings, 0 replies; 3+ messages in thread
From: Niklas Cassel @ 2026-09-08 11:43 UTC (permalink / raw)
  To: dlemoal, linux-ide, Li Jun

On Tue, Sep 08, 2026 at 01:36:53PM +0200, Niklas Cassel wrote:
> On Tue, 08 Sep 2026 17:49:01 +0800, Li Jun wrote:
> > Replace the deprecated SIMPLE_DEV_PM_OPS macro with the recommended
> > DEFINE_SIMPLE_DEV_PM_OPS. Use pm_ptr(&ahci_da850_pm_ops) to complete
> > the API migration and allow the structure to be correctly dropped
> > when CONFIG_PM=n.

CONFIG_PM_SLEEP=n.
(i.e. you can have CONFIG_PM=y and CONFIG_PM_SLEEP=n and the callbacks will
still be dropped).

Repushed it with the fixed up commit message:
https://git.kernel.org/pub/scm/linux/kernel/git/libata/linux.git/commit/?id=f091e60fc986eb12ff632f682848b88da824bccb


Kind regards,
Niklas

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

end of thread, other threads:[~2026-09-08 11:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-08  9:49 [PATCH v5] ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS Li Jun
2026-09-08 11:36 ` Niklas Cassel
2026-09-08 11:43   ` Niklas Cassel

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