Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: KyungMin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

MyungJoo Ham and committed by
Greg Kroah-Hartman
aef7fe52 f2eb3cdf

+14 -13
+14 -13
drivers/tty/serial/samsung.c
··· 1194 1194 EXPORT_SYMBOL_GPL(s3c24xx_serial_remove); 1195 1195 1196 1196 /* UART power management code */ 1197 - 1198 - #ifdef CONFIG_PM 1199 - 1200 - static int s3c24xx_serial_suspend(struct platform_device *dev, pm_message_t state) 1197 + #ifdef CONFIG_PM_SLEEP 1198 + static int s3c24xx_serial_suspend(struct device *dev) 1201 1199 { 1202 - struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); 1200 + struct uart_port *port = s3c24xx_dev_to_port(dev); 1203 1201 1204 1202 if (port) 1205 1203 uart_suspend_port(&s3c24xx_uart_drv, port); ··· 1205 1207 return 0; 1206 1208 } 1207 1209 1208 - static int s3c24xx_serial_resume(struct platform_device *dev) 1210 + static int s3c24xx_serial_resume(struct device *dev) 1209 1211 { 1210 - struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); 1212 + struct uart_port *port = s3c24xx_dev_to_port(dev); 1211 1213 struct s3c24xx_uart_port *ourport = to_ourport(port); 1212 1214 1213 1215 if (port) { ··· 1220 1222 1221 1223 return 0; 1222 1224 } 1223 - #endif 1225 + 1226 + static const struct dev_pm_ops s3c24xx_serial_pm_ops = { 1227 + .suspend = s3c24xx_serial_suspend, 1228 + .resume = s3c24xx_serial_resume, 1229 + }; 1230 + #else /* !CONFIG_PM_SLEEP */ 1231 + #define s3c24xx_serial_pm_ops NULL 1232 + #endif /* CONFIG_PM_SLEEP */ 1224 1233 1225 1234 int s3c24xx_serial_init(struct platform_driver *drv, 1226 1235 struct s3c24xx_uart_info *info) 1227 1236 { 1228 1237 dbg("s3c24xx_serial_init(%p,%p)\n", drv, info); 1229 - 1230 - #ifdef CONFIG_PM 1231 - drv->suspend = s3c24xx_serial_suspend; 1232 - drv->resume = s3c24xx_serial_resume; 1233 - #endif 1238 + drv->driver.pm = &s3c24xx_serial_pm_ops; 1234 1239 1235 1240 return platform_driver_register(drv); 1236 1241 }