From 9598f73f14bb2a1d4e8fcc38c108c005f23dc4fe Mon Sep 17 00:00:00 2001 From: Li Jun Date: Tue, 8 Sep 2026 19:37:19 +0800 Subject: [PATCH] tty: atmel: Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS 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 Link: https://patch.msgid.link/20260908113719.4078979-1-lijun01@kylinos.cn Signed-off-by: Greg Kroah-Hartman --- 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), }, }; -- knotmirror 0.0.1