tty: serial: samsung: Set missing PM ops for hibernation support
authorAnton Eliasson <anton.eliasson@axis.com>
Thu, 3 Aug 2023 11:26:42 +0000 (13:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Aug 2023 13:06:24 +0000 (15:06 +0200)
At least freeze, restore and thaw need to be set in order for the driver
to support system hibernation. The existing suspend/resume functions can
be reused since those functions don't touch the device's power state or
wakeup capability. Use the helper macros SET_SYSTEM_SLEEP_PM_OPS and
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS for symmetry with similar drivers.

Signed-off-by: Anton Eliasson <anton.eliasson@axis.com>
Link: https://lore.kernel.org/r/20230803-samsung_tty_pm_ops-v1-1-1ea7be72194d@axis.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/samsung_tty.c

index aa4a184f4a6c709268f986b2dd7166ad3d1df191..07fb8a9dac63361d1af5f2f20f85fcf13406dc24 100644 (file)
@@ -2274,9 +2274,8 @@ static int s3c24xx_serial_resume_noirq(struct device *dev)
 }
 
 static const struct dev_pm_ops s3c24xx_serial_pm_ops = {
-       .suspend = s3c24xx_serial_suspend,
-       .resume = s3c24xx_serial_resume,
-       .resume_noirq = s3c24xx_serial_resume_noirq,
+       SET_SYSTEM_SLEEP_PM_OPS(s3c24xx_serial_suspend, s3c24xx_serial_resume)
+       SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, s3c24xx_serial_resume_noirq)
 };
 #define SERIAL_SAMSUNG_PM_OPS  (&s3c24xx_serial_pm_ops)