Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH] tty: atmel: Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
@ 2026-09-08 11:37 Li Jun
  2026-09-08 11:44 ` sashiko-bot
  2026-09-25 13:40 ` Richard GENOUD
  0 siblings, 2 replies; 9+ messages in thread
From: Li Jun @ 2026-09-08 11:37 UTC (permalink / raw)
  To: lijun01, richard.genoud, gregkh, jirislaby, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linux-serial

Replace the deprecated SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS.
This also drops the __maybe_unused annotations on the suspend/resume
callbacks, since pm_sleep_ptr() inside the new macro already handles
the case where CONFIG_PM_SLEEP is disabled.
When CONFIG_PM=y but CONFIG_PM_SLEEP=n (a valid configuration that
enables runtime PM but disables system suspend/hibernation), this
keeps a completely empty dev_pm_ops structure -- all callbacks are
NULL -- as dead code in the object file.Modify pm_ptr to pm_sleep_ptr.

Signed-off-by: Li Jun <lijun01@kylinos.cn>
---
 drivers/tty/serial/atmel_serial.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 5d8c1cfc1c60..c3880259e3bc 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -2723,7 +2723,7 @@ static bool atmel_serial_clk_will_stop(void)
 #endif
 }
 
-static int __maybe_unused atmel_serial_suspend(struct device *dev)
+static int atmel_serial_suspend(struct device *dev)
 {
 	struct uart_port *port = dev_get_drvdata(dev);
 	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
@@ -2765,7 +2765,7 @@ static int __maybe_unused atmel_serial_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused atmel_serial_resume(struct device *dev)
+static int atmel_serial_resume(struct device *dev)
 {
 	struct uart_port *port = dev_get_drvdata(dev);
 	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
@@ -2996,7 +2996,7 @@ static void atmel_serial_remove(struct platform_device *pdev)
 	pdev->dev.of_node = NULL;
 }
 
-static SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend,
+static DEFINE_SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend,
 			 atmel_serial_resume);
 
 static struct platform_driver atmel_serial_driver = {
@@ -3005,7 +3005,7 @@ static struct platform_driver atmel_serial_driver = {
 	.driver		= {
 		.name			= "atmel_usart_serial",
 		.of_match_table		= of_match_ptr(atmel_serial_dt_ids),
-		.pm			= pm_ptr(&atmel_serial_pm_ops),
+		.pm			= pm_sleep_ptr(&atmel_serial_pm_ops),
 	},
 };
 
-- 
2.25.1


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

* Re: [PATCH] tty: atmel: Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
  2026-09-08 11:37 Li Jun
@ 2026-09-08 11:44 ` sashiko-bot
  2026-09-25 13:40 ` Richard GENOUD
  1 sibling, 0 replies; 9+ messages in thread
From: sashiko-bot @ 2026-09-08 11:44 UTC (permalink / raw)
  To: Li Jun; +Cc: linux-serial

> Replace the deprecated SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS.
> This also drops the __maybe_unused annotations on the suspend/resume
> callbacks, since pm_sleep_ptr() inside the new macro already handles
> the case where CONFIG_PM_SLEEP is disabled.
> When CONFIG_PM=y but CONFIG_PM_SLEEP=n (a valid configuration that
> enables runtime PM but disables system suspend/hibernation), this
> keeps a completely empty dev_pm_ops structure -- all callbacks are
> NULL -- as dead code in the object file.Modify pm_ptr to pm_sleep_ptr.
> 
> Signed-off-by: Li Jun <lijun01@kylinos.cn>

Sashiko has reviewed this patch and found no issues. It looks great!

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


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

* Re: [PATCH] tty: atmel: Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
  2026-09-08 11:37 Li Jun
  2026-09-08 11:44 ` sashiko-bot
@ 2026-09-25 13:40 ` Richard GENOUD
  2026-10-20  8:29   ` Richard GENOUD
  1 sibling, 1 reply; 9+ messages in thread
From: Richard GENOUD @ 2026-09-25 13:40 UTC (permalink / raw)
  To: Li Jun, gregkh, jirislaby, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, linux-serial

Le 08/09/2026 à 13:37, Li Jun a écrit :
> Replace the deprecated SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS.
> This also drops the __maybe_unused annotations on the suspend/resume
> callbacks, since pm_sleep_ptr() inside the new macro already handles
> the case where CONFIG_PM_SLEEP is disabled.
> When CONFIG_PM=y but CONFIG_PM_SLEEP=n (a valid configuration that
> enables runtime PM but disables system suspend/hibernation), this
> keeps a completely empty dev_pm_ops structure -- all callbacks are
> NULL -- as dead code in the object file.Modify pm_ptr to pm_sleep_ptr.
> 
Acked-by: Richard Genoud <richard.genoud@bootlin.com>

> Signed-off-by: Li Jun <lijun01@kylinos.cn>
> ---
>   drivers/tty/serial/atmel_serial.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index 5d8c1cfc1c60..c3880259e3bc 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -2723,7 +2723,7 @@ static bool atmel_serial_clk_will_stop(void)
>   #endif
>   }
>   
> -static int __maybe_unused atmel_serial_suspend(struct device *dev)
> +static int atmel_serial_suspend(struct device *dev)
>   {
>   	struct uart_port *port = dev_get_drvdata(dev);
>   	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
> @@ -2765,7 +2765,7 @@ static int __maybe_unused atmel_serial_suspend(struct device *dev)
>   	return 0;
>   }
>   
> -static int __maybe_unused atmel_serial_resume(struct device *dev)
> +static int atmel_serial_resume(struct device *dev)
>   {
>   	struct uart_port *port = dev_get_drvdata(dev);
>   	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
> @@ -2996,7 +2996,7 @@ static void atmel_serial_remove(struct platform_device *pdev)
>   	pdev->dev.of_node = NULL;
>   }
>   
> -static SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend,
> +static DEFINE_SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend,
>   			 atmel_serial_resume);
>   
>   static struct platform_driver atmel_serial_driver = {
> @@ -3005,7 +3005,7 @@ static struct platform_driver atmel_serial_driver = {
>   	.driver		= {
>   		.name			= "atmel_usart_serial",
>   		.of_match_table		= of_match_ptr(atmel_serial_dt_ids),
> -		.pm			= pm_ptr(&atmel_serial_pm_ops),
> +		.pm			= pm_sleep_ptr(&atmel_serial_pm_ops),
>   	},
>   };
>   

Thanks!

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

* Re: [PATCH] tty: atmel: Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
  2026-09-25 13:40 ` Richard GENOUD
@ 2026-10-20  8:29   ` Richard GENOUD
  2026-10-20  8:34     ` lijun
  0 siblings, 1 reply; 9+ messages in thread
From: Richard GENOUD @ 2026-10-20  8:29 UTC (permalink / raw)
  To: Li Jun
  Cc: gregkh, jirislaby, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, linux-serial

Le 25/09/2026 à 15:40, Richard GENOUD a écrit :
> Le 08/09/2026 à 13:37, Li Jun a écrit :
>> Replace the deprecated SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS.
>> This also drops the __maybe_unused annotations on the suspend/resume
>> callbacks, since pm_sleep_ptr() inside the new macro already handles
>> the case where CONFIG_PM_SLEEP is disabled.
>> When CONFIG_PM=y but CONFIG_PM_SLEEP=n (a valid configuration that
>> enables runtime PM but disables system suspend/hibernation), this
>> keeps a completely empty dev_pm_ops structure -- all callbacks are
>> NULL -- as dead code in the object file.Modify pm_ptr to pm_sleep_ptr.
>>
> Acked-by: Richard Genoud <richard.genoud@bootlin.com>
> 
>> Signed-off-by: Li Jun <lijun01@kylinos.cn>

It seems this patch got lost, could you re-send it?

Regards,
Richard

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

* Re: [PATCH] tty: atmel: Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
  2026-10-20  8:29   ` Richard GENOUD
@ 2026-10-20  8:34     ` lijun
  0 siblings, 0 replies; 9+ messages in thread
From: lijun @ 2026-10-20  8:34 UTC (permalink / raw)
  To: Richard GENOUD
  Cc: gregkh, jirislaby, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, linux-serial

ok ,i will re-send it.

  2026/10/20 16:29, Richard GENOUD :
> re-send it

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

* [PATCH] tty: atmel: Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
@ 2026-10-20  8:41 Li Jun
  2026-10-20  8:47 ` Richard GENOUD
  2026-10-20  8:53 ` sashiko-bot
  0 siblings, 2 replies; 9+ messages in thread
From: Li Jun @ 2026-10-20  8:41 UTC (permalink / raw)
  To: lijun01, richard.genoud, gregkh, jirislaby, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linux-serial

Replace the deprecated SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS.
This also drops the __maybe_unused annotations on the suspend/resume
callbacks, since pm_sleep_ptr() inside the new macro already handles
the case where CONFIG_PM_SLEEP is disabled.
When CONFIG_PM=y but CONFIG_PM_SLEEP=n (a valid configuration that
enables runtime PM but disables system suspend/hibernation), this
keeps a completely empty dev_pm_ops structure -- all callbacks are
NULL -- as dead code in the object file.Modify pm_ptr to pm_sleep_ptr.

Signed-off-by: Li Jun <lijun01@kylinos.cn>
---
 drivers/tty/serial/atmel_serial.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 5d8c1cfc1c60..c3880259e3bc 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -2723,7 +2723,7 @@ static bool atmel_serial_clk_will_stop(void)
 #endif
 }
 
-static int __maybe_unused atmel_serial_suspend(struct device *dev)
+static int atmel_serial_suspend(struct device *dev)
 {
 	struct uart_port *port = dev_get_drvdata(dev);
 	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
@@ -2765,7 +2765,7 @@ static int __maybe_unused atmel_serial_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused atmel_serial_resume(struct device *dev)
+static int atmel_serial_resume(struct device *dev)
 {
 	struct uart_port *port = dev_get_drvdata(dev);
 	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
@@ -2996,7 +2996,7 @@ static void atmel_serial_remove(struct platform_device *pdev)
 	pdev->dev.of_node = NULL;
 }
 
-static SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend,
+static DEFINE_SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend,
 			 atmel_serial_resume);
 
 static struct platform_driver atmel_serial_driver = {
@@ -3005,7 +3005,7 @@ static struct platform_driver atmel_serial_driver = {
 	.driver		= {
 		.name			= "atmel_usart_serial",
 		.of_match_table		= of_match_ptr(atmel_serial_dt_ids),
-		.pm			= pm_ptr(&atmel_serial_pm_ops),
+		.pm			= pm_sleep_ptr(&atmel_serial_pm_ops),
 	},
 };
 
-- 
2.25.1


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

* Re: [PATCH] tty: atmel: Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
  2026-10-20  8:41 [PATCH] tty: atmel: Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS Li Jun
@ 2026-10-20  8:47 ` Richard GENOUD
  2026-10-20  9:22   ` lijun
  2026-10-20  8:53 ` sashiko-bot
  1 sibling, 1 reply; 9+ messages in thread
From: Richard GENOUD @ 2026-10-20  8:47 UTC (permalink / raw)
  To: Li Jun, gregkh, jirislaby, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, linux-serial

Le 20/10/2026 à 10:41, Li Jun a écrit :
> Replace the deprecated SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS.
> This also drops the __maybe_unused annotations on the suspend/resume
> callbacks, since pm_sleep_ptr() inside the new macro already handles
> the case where CONFIG_PM_SLEEP is disabled.
> When CONFIG_PM=y but CONFIG_PM_SLEEP=n (a valid configuration that
> enables runtime PM but disables system suspend/hibernation), this
> keeps a completely empty dev_pm_ops structure -- all callbacks are
> NULL -- as dead code in the object file.Modify pm_ptr to pm_sleep_ptr.
> 
Re-addind my acked-by, since it wasn't gather
(For next time, when you resend a patch, you may add [PATCH RESEND] in 
the subject)

Acked-by: Richard Genoud <richard.genoud@bootlin.com>
> Signed-off-by: Li Jun <lijun01@kylinos.cn>
> ---
>   drivers/tty/serial/atmel_serial.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index 5d8c1cfc1c60..c3880259e3bc 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -2723,7 +2723,7 @@ static bool atmel_serial_clk_will_stop(void)
>   #endif
>   }
>   
> -static int __maybe_unused atmel_serial_suspend(struct device *dev)
> +static int atmel_serial_suspend(struct device *dev)
>   {
>   	struct uart_port *port = dev_get_drvdata(dev);
>   	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
> @@ -2765,7 +2765,7 @@ static int __maybe_unused atmel_serial_suspend(struct device *dev)
>   	return 0;
>   }
>   
> -static int __maybe_unused atmel_serial_resume(struct device *dev)
> +static int atmel_serial_resume(struct device *dev)
>   {
>   	struct uart_port *port = dev_get_drvdata(dev);
>   	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
> @@ -2996,7 +2996,7 @@ static void atmel_serial_remove(struct platform_device *pdev)
>   	pdev->dev.of_node = NULL;
>   }
>   
> -static SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend,
> +static DEFINE_SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend,
>   			 atmel_serial_resume);
>   
>   static struct platform_driver atmel_serial_driver = {
> @@ -3005,7 +3005,7 @@ static struct platform_driver atmel_serial_driver = {
>   	.driver		= {
>   		.name			= "atmel_usart_serial",
>   		.of_match_table		= of_match_ptr(atmel_serial_dt_ids),
> -		.pm			= pm_ptr(&atmel_serial_pm_ops),
> +		.pm			= pm_sleep_ptr(&atmel_serial_pm_ops),
>   	},
>   };
>   


-- 
Richard Genoud, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH] tty: atmel: Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
  2026-10-20  8:41 [PATCH] tty: atmel: Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS Li Jun
  2026-10-20  8:47 ` Richard GENOUD
@ 2026-10-20  8:53 ` sashiko-bot
  1 sibling, 0 replies; 9+ messages in thread
From: sashiko-bot @ 2026-10-20  8:53 UTC (permalink / raw)
  To: Li Jun, linux-serial

> Replace the deprecated SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS.
> This also drops the __maybe_unused annotations on the suspend/resume
> callbacks, since pm_sleep_ptr() inside the new macro already handles
> the case where CONFIG_PM_SLEEP is disabled.
> When CONFIG_PM=y but CONFIG_PM_SLEEP=n (a valid configuration that
> enables runtime PM but disables system suspend/hibernation), this
> keeps a completely empty dev_pm_ops structure -- all callbacks are
> NULL -- as dead code in the object file.Modify pm_ptr to pm_sleep_ptr.
> 
> Signed-off-by: Li Jun <lijun01@kylinos.cn>

Sashiko has reviewed this patch and found no issues.

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


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

* Re: [PATCH] tty: atmel: Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
  2026-10-20  8:47 ` Richard GENOUD
@ 2026-10-20  9:22   ` lijun
  0 siblings, 0 replies; 9+ messages in thread
From: lijun @ 2026-10-20  9:22 UTC (permalink / raw)
  To: Richard GENOUD
  Cc: gregkh, jirislaby, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, linux-serial

Thank you for your  suggestion, next time, i will  add [PATCH RESEND] in 
the subject.

  2026/10/20 16:47, Richard GENOUD :
> add [PATCH RESEND] in the subject

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

end of thread, other threads:[~2026-10-20  9:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-20  8:41 [PATCH] tty: atmel: Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS Li Jun
2026-10-20  8:47 ` Richard GENOUD
2026-10-20  9:22   ` lijun
2026-10-20  8:53 ` sashiko-bot
  -- strict thread matches above, loose matches on Subject: below --
2026-09-08 11:37 Li Jun
2026-09-08 11:44 ` sashiko-bot
2026-09-25 13:40 ` Richard GENOUD
2026-10-20  8:29   ` Richard GENOUD
2026-10-20  8:34     ` lijun

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