diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-03-11 13:44:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-18 19:29:29 -0400 |
commit | c2ee91bd6644324160ba9e090e3a017d62abc0b4 (patch) | |
tree | d52d496d815dde176da317da3a8742b7bf82b3be | |
parent | b7df719db7326d51a3145bb0cfc277aeb50763c3 (diff) |
tty: mrst_max3110: Use dev_pm_ops
Use dev_pm_ops instead of the deprecated legacy suspend/resume for the
mrst_max3110 driver.
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/mrst_max3110.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/tty/serial/mrst_max3110.c b/drivers/tty/serial/mrst_max3110.c index f641c232beca..9b6ef20420c0 100644 --- a/drivers/tty/serial/mrst_max3110.c +++ b/drivers/tty/serial/mrst_max3110.c | |||
@@ -743,9 +743,10 @@ static struct uart_driver serial_m3110_reg = { | |||
743 | .cons = &serial_m3110_console, | 743 | .cons = &serial_m3110_console, |
744 | }; | 744 | }; |
745 | 745 | ||
746 | #ifdef CONFIG_PM | 746 | #ifdef CONFIG_PM_SLEEP |
747 | static int serial_m3110_suspend(struct spi_device *spi, pm_message_t state) | 747 | static int serial_m3110_suspend(struct device *dev) |
748 | { | 748 | { |
749 | struct spi_device *spi = to_spi_device(dev); | ||
749 | struct uart_max3110 *max = spi_get_drvdata(spi); | 750 | struct uart_max3110 *max = spi_get_drvdata(spi); |
750 | 751 | ||
751 | disable_irq(max->irq); | 752 | disable_irq(max->irq); |
@@ -754,8 +755,9 @@ static int serial_m3110_suspend(struct spi_device *spi, pm_message_t state) | |||
754 | return 0; | 755 | return 0; |
755 | } | 756 | } |
756 | 757 | ||
757 | static int serial_m3110_resume(struct spi_device *spi) | 758 | static int serial_m3110_resume(struct device *dev) |
758 | { | 759 | { |
760 | struct spi_device *spi = to_spi_device(dev); | ||
759 | struct uart_max3110 *max = spi_get_drvdata(spi); | 761 | struct uart_max3110 *max = spi_get_drvdata(spi); |
760 | 762 | ||
761 | max3110_out(max, max->cur_conf); | 763 | max3110_out(max, max->cur_conf); |
@@ -763,9 +765,13 @@ static int serial_m3110_resume(struct spi_device *spi) | |||
763 | enable_irq(max->irq); | 765 | enable_irq(max->irq); |
764 | return 0; | 766 | return 0; |
765 | } | 767 | } |
768 | |||
769 | static SIMPLE_DEV_PM_OPS(serial_m3110_pm_ops, serial_m3110_suspend, | ||
770 | serial_m3110_resume); | ||
771 | #define SERIAL_M3110_PM_OPS (&serial_m3110_pm_ops) | ||
772 | |||
766 | #else | 773 | #else |
767 | #define serial_m3110_suspend NULL | 774 | #define SERIAL_M3110_PM_OPS NULL |
768 | #define serial_m3110_resume NULL | ||
769 | #endif | 775 | #endif |
770 | 776 | ||
771 | static int serial_m3110_probe(struct spi_device *spi) | 777 | static int serial_m3110_probe(struct spi_device *spi) |
@@ -872,11 +878,10 @@ static struct spi_driver uart_max3110_driver = { | |||
872 | .driver = { | 878 | .driver = { |
873 | .name = "spi_max3111", | 879 | .name = "spi_max3111", |
874 | .owner = THIS_MODULE, | 880 | .owner = THIS_MODULE, |
881 | .pm = SERIAL_M3110_PM_OPS, | ||
875 | }, | 882 | }, |
876 | .probe = serial_m3110_probe, | 883 | .probe = serial_m3110_probe, |
877 | .remove = serial_m3110_remove, | 884 | .remove = serial_m3110_remove, |
878 | .suspend = serial_m3110_suspend, | ||
879 | .resume = serial_m3110_resume, | ||
880 | }; | 885 | }; |
881 | 886 | ||
882 | static int __init serial_m3110_init(void) | 887 | static int __init serial_m3110_init(void) |