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

tty: max310x: Use dev_pm_ops

Use dev_pm_ops instead of the deprecated legacy suspend/resume for the
max310x driver.

Cc: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Lars-Peter Clausen and committed by
Greg Kroah-Hartman
b7df719d c47ddc26

+16 -8
+16 -8
drivers/tty/serial/max310x.c
··· 881 881 .verify_port = max310x_verify_port, 882 882 }; 883 883 884 - static int max310x_suspend(struct spi_device *spi, pm_message_t state) 884 + #ifdef CONFIG_PM_SLEEP 885 + 886 + static int max310x_suspend(struct device *dev) 885 887 { 886 888 int ret; 887 - struct max310x_port *s = dev_get_drvdata(&spi->dev); 889 + struct max310x_port *s = dev_get_drvdata(dev); 888 890 889 - dev_dbg(&spi->dev, "Suspend\n"); 891 + dev_dbg(dev, "Suspend\n"); 890 892 891 893 ret = uart_suspend_port(&s->uart, &s->port); 892 894 ··· 907 905 return ret; 908 906 } 909 907 910 - static int max310x_resume(struct spi_device *spi) 908 + static int max310x_resume(struct device *dev) 911 909 { 912 - struct max310x_port *s = dev_get_drvdata(&spi->dev); 910 + struct max310x_port *s = dev_get_drvdata(dev); 913 911 914 - dev_dbg(&spi->dev, "Resume\n"); 912 + dev_dbg(dev, "Resume\n"); 915 913 916 914 if (s->pdata->suspend) 917 915 s->pdata->suspend(0); ··· 929 927 930 928 return uart_resume_port(&s->uart, &s->port); 931 929 } 930 + 931 + static SIMPLE_DEV_PM_OPS(max310x_pm_ops, max310x_suspend, max310x_resume); 932 + #define MAX310X_PM_OPS (&max310x_pm_ops) 933 + 934 + #else 935 + #define MAX310X_PM_OPS NULL 936 + #endif 932 937 933 938 #ifdef CONFIG_GPIOLIB 934 939 static int max310x_gpio_get(struct gpio_chip *chip, unsigned offset) ··· 1251 1242 .driver = { 1252 1243 .name = "max310x", 1253 1244 .owner = THIS_MODULE, 1245 + .pm = MAX310X_PM_OPS, 1254 1246 }, 1255 1247 .probe = max310x_probe, 1256 1248 .remove = max310x_remove, 1257 - .suspend = max310x_suspend, 1258 - .resume = max310x_resume, 1259 1249 .id_table = max310x_id_table, 1260 1250 }; 1261 1251 module_spi_driver(max310x_driver);