Commit aef7fe52 authored by MyungJoo Ham's avatar MyungJoo Ham Committed by Greg Kroah-Hartman

tty: serial: samsung.c remove legacy PM code.

This patch "modernize" tty/serial/samsung.c to use non-legacy code for
suspend/resume.
Signed-off-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: default avatarKyungMin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f2eb3cdf
...@@ -1194,12 +1194,10 @@ int __devexit s3c24xx_serial_remove(struct platform_device *dev) ...@@ -1194,12 +1194,10 @@ int __devexit s3c24xx_serial_remove(struct platform_device *dev)
EXPORT_SYMBOL_GPL(s3c24xx_serial_remove); EXPORT_SYMBOL_GPL(s3c24xx_serial_remove);
/* UART power management code */ /* UART power management code */
#ifdef CONFIG_PM_SLEEP
#ifdef CONFIG_PM static int s3c24xx_serial_suspend(struct device *dev)
static int s3c24xx_serial_suspend(struct platform_device *dev, pm_message_t state)
{ {
struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); struct uart_port *port = s3c24xx_dev_to_port(dev);
if (port) if (port)
uart_suspend_port(&s3c24xx_uart_drv, port); uart_suspend_port(&s3c24xx_uart_drv, port);
...@@ -1207,9 +1205,9 @@ static int s3c24xx_serial_suspend(struct platform_device *dev, pm_message_t stat ...@@ -1207,9 +1205,9 @@ static int s3c24xx_serial_suspend(struct platform_device *dev, pm_message_t stat
return 0; return 0;
} }
static int s3c24xx_serial_resume(struct platform_device *dev) static int s3c24xx_serial_resume(struct device *dev)
{ {
struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); struct uart_port *port = s3c24xx_dev_to_port(dev);
struct s3c24xx_uart_port *ourport = to_ourport(port); struct s3c24xx_uart_port *ourport = to_ourport(port);
if (port) { if (port) {
...@@ -1222,17 +1220,20 @@ static int s3c24xx_serial_resume(struct platform_device *dev) ...@@ -1222,17 +1220,20 @@ static int s3c24xx_serial_resume(struct platform_device *dev)
return 0; return 0;
} }
#endif
static const struct dev_pm_ops s3c24xx_serial_pm_ops = {
.suspend = s3c24xx_serial_suspend,
.resume = s3c24xx_serial_resume,
};
#else /* !CONFIG_PM_SLEEP */
#define s3c24xx_serial_pm_ops NULL
#endif /* CONFIG_PM_SLEEP */
int s3c24xx_serial_init(struct platform_driver *drv, int s3c24xx_serial_init(struct platform_driver *drv,
struct s3c24xx_uart_info *info) struct s3c24xx_uart_info *info)
{ {
dbg("s3c24xx_serial_init(%p,%p)\n", drv, info); dbg("s3c24xx_serial_init(%p,%p)\n", drv, info);
drv->driver.pm = &s3c24xx_serial_pm_ops;
#ifdef CONFIG_PM
drv->suspend = s3c24xx_serial_suspend;
drv->resume = s3c24xx_serial_resume;
#endif
return platform_driver_register(drv); return platform_driver_register(drv);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment