diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-03-11 13:44:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-18 19:29:29 -0400 |
commit | b7df719db7326d51a3145bb0cfc277aeb50763c3 (patch) | |
tree | ad1c74c79d48d40ade368b10ae69b03ba73e10fc /drivers/tty/serial/max310x.c | |
parent | c47ddc26db389e046c1414c78ac4a6016c7df500 (diff) |
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>
Diffstat (limited to 'drivers/tty/serial/max310x.c')
-rw-r--r-- | drivers/tty/serial/max310x.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 0c2422cb04ea..8941e6418942 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c | |||
@@ -881,12 +881,14 @@ static struct uart_ops max310x_ops = { | |||
881 | .verify_port = max310x_verify_port, | 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 | int ret; | 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 | ret = uart_suspend_port(&s->uart, &s->port); | 893 | ret = uart_suspend_port(&s->uart, &s->port); |
892 | 894 | ||
@@ -905,11 +907,11 @@ static int max310x_suspend(struct spi_device *spi, pm_message_t state) | |||
905 | return ret; | 907 | return ret; |
906 | } | 908 | } |
907 | 909 | ||
908 | static int max310x_resume(struct spi_device *spi) | 910 | static int max310x_resume(struct device *dev) |
909 | { | 911 | { |
910 | struct max310x_port *s = dev_get_drvdata(&spi->dev); | 912 | struct max310x_port *s = dev_get_drvdata(dev); |
911 | 913 | ||
912 | dev_dbg(&spi->dev, "Resume\n"); | 914 | dev_dbg(dev, "Resume\n"); |
913 | 915 | ||
914 | if (s->pdata->suspend) | 916 | if (s->pdata->suspend) |
915 | s->pdata->suspend(0); | 917 | s->pdata->suspend(0); |
@@ -928,6 +930,13 @@ static int max310x_resume(struct spi_device *spi) | |||
928 | return uart_resume_port(&s->uart, &s->port); | 930 | return uart_resume_port(&s->uart, &s->port); |
929 | } | 931 | } |
930 | 932 | ||
933 | static SIMPLE_DEV_PM_OPS(max310x_pm_ops, max310x_suspend, max310x_resume); | ||
934 | #define MAX310X_PM_OPS (&max310x_pm_ops) | ||
935 | |||
936 | #else | ||
937 | #define MAX310X_PM_OPS NULL | ||
938 | #endif | ||
939 | |||
931 | #ifdef CONFIG_GPIOLIB | 940 | #ifdef CONFIG_GPIOLIB |
932 | static int max310x_gpio_get(struct gpio_chip *chip, unsigned offset) | 941 | static int max310x_gpio_get(struct gpio_chip *chip, unsigned offset) |
933 | { | 942 | { |
@@ -1242,11 +1251,10 @@ static struct spi_driver max310x_driver = { | |||
1242 | .driver = { | 1251 | .driver = { |
1243 | .name = "max310x", | 1252 | .name = "max310x", |
1244 | .owner = THIS_MODULE, | 1253 | .owner = THIS_MODULE, |
1254 | .pm = MAX310X_PM_OPS, | ||
1245 | }, | 1255 | }, |
1246 | .probe = max310x_probe, | 1256 | .probe = max310x_probe, |
1247 | .remove = max310x_remove, | 1257 | .remove = max310x_remove, |
1248 | .suspend = max310x_suspend, | ||
1249 | .resume = max310x_resume, | ||
1250 | .id_table = max310x_id_table, | 1258 | .id_table = max310x_id_table, |
1251 | }; | 1259 | }; |
1252 | module_spi_driver(max310x_driver); | 1260 | module_spi_driver(max310x_driver); |