All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS
@ 2026-09-08  2:30 Li Jun
  2026-09-08  2:40 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Li Jun @ 2026-09-08  2:30 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.

Signed-off-by: Li Jun <lijun01@kylinos.cn>
---
 drivers/ata/ahci_da850.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c
index 4e53ff96d712..9c8b4f9eb9fe 100644
--- a/drivers/ata/ahci_da850.c
+++ b/drivers/ata/ahci_da850.c
@@ -218,7 +218,7 @@ static int ahci_da850_probe(struct platform_device *pdev)
 	return rc;
 }
 
-static SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, ahci_platform_suspend,
+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[] = {
-- 
2.25.1


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

* Re: [PATCH] ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS
  2026-09-08  2:30 [PATCH] ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS Li Jun
@ 2026-09-08  2:40 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-09-08  2:40 UTC (permalink / raw)
  To: Li Jun; +Cc: cassel, linux-ide, dlemoal

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing pm_ptr() wrapper when assigning dev_pm_ops, causing an incomplete API migration and dead code retention when PM is disabled.
--

commit 4fb37d41387c46fd87ad058aea812f8fa3640dc6
Author: Li Jun <lijun01@kylinos.cn>

ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS
    
Replace the deprecated SIMPLE_DEV_PM_OPS macro with the recommended
DEFINE_SIMPLE_DEV_PM_OPS.

> diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c
> index f97566c420f84..ca874f097c2b1 100644
> --- a/drivers/ata/ahci_da850.c
> +++ b/drivers/ata/ahci_da850.c
> @@ -227,7 +227,7 @@ static int ahci_da850_probe(struct platform_device *pdev)
>  	return rc;
>  }
>  
> -static SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, ahci_platform_suspend,
> +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, ahci_platform_suspend,
>  			 ahci_platform_resume);

[Severity: Low]
Should this change also update the driver definition to use the pm_ptr()
macro?

The goal of migrating to DEFINE_SIMPLE_DEV_PM_OPS is to allow dead code
elimination when PM is disabled. However, ahci_da850_pm_ops is still
unconditionally referenced in the ahci_da850_driver structure:

static struct platform_driver ahci_da850_driver = {
	...
	.driver = {
		.name = DRV_NAME,
		.of_match_table = ahci_da850_of_match,
		.pm = &ahci_da850_pm_ops,
	},
};

Can we wrap the assignment with pm_ptr(&ahci_da850_pm_ops) to complete the
API migration and allow the structure to be correctly dropped when CONFIG_PM=n?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260908023054.574049-1-lijun01@kylinos.cn?part=1

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-08  2:30 [PATCH] ata: ahci_da850: switch to DEFINE_SIMPLE_DEV_PM_OPS Li Jun
2026-09-08  2:40 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.