diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-06-20 12:38:46 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-06-26 09:16:26 -0400 |
commit | 0268d130ab16668cd32428035ed0bd56bf124239 (patch) | |
tree | ebcf4c71062c7ccc280970e86e6e12559bfe9ec3 /drivers/video/bfin-lq035q1-fb.c | |
parent | 2c30aba2b2894ceb2108f1cb2602015b121e9a81 (diff) |
fbdev: bfin-lq035q1-fb: Use dev_pm_ops
Use dev_pm_ops instead of the legacy suspend/resume callbacks.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/bfin-lq035q1-fb.c')
-rw-r--r-- | drivers/video/bfin-lq035q1-fb.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c index be65baec7889..b594a58ff21d 100644 --- a/drivers/video/bfin-lq035q1-fb.c +++ b/drivers/video/bfin-lq035q1-fb.c | |||
@@ -170,16 +170,19 @@ static int lq035q1_spidev_remove(struct spi_device *spi) | |||
170 | return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); | 170 | return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); |
171 | } | 171 | } |
172 | 172 | ||
173 | #ifdef CONFIG_PM | 173 | #ifdef CONFIG_PM_SLEEP |
174 | static int lq035q1_spidev_suspend(struct spi_device *spi, pm_message_t state) | 174 | static int lq035q1_spidev_suspend(struct device *dev) |
175 | { | 175 | { |
176 | struct spi_device *spi = to_spi_device(dev); | ||
177 | |||
176 | return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); | 178 | return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); |
177 | } | 179 | } |
178 | 180 | ||
179 | static int lq035q1_spidev_resume(struct spi_device *spi) | 181 | static int lq035q1_spidev_resume(struct device *dev) |
180 | { | 182 | { |
181 | int ret; | 183 | struct spi_device *spi = to_spi_device(dev); |
182 | struct spi_control *ctl = spi_get_drvdata(spi); | 184 | struct spi_control *ctl = spi_get_drvdata(spi); |
185 | int ret; | ||
183 | 186 | ||
184 | ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode); | 187 | ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode); |
185 | if (ret) | 188 | if (ret) |
@@ -187,9 +190,13 @@ static int lq035q1_spidev_resume(struct spi_device *spi) | |||
187 | 190 | ||
188 | return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON); | 191 | return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON); |
189 | } | 192 | } |
193 | |||
194 | static SIMPLE_DEV_PM_OPS(lq035q1_spidev_pm_ops, lq035q1_spidev_suspend, | ||
195 | lq035q1_spidev_resume); | ||
196 | #define LQ035Q1_SPIDEV_PM_OPS (&lq035q1_spidev_pm_ops) | ||
197 | |||
190 | #else | 198 | #else |
191 | # define lq035q1_spidev_suspend NULL | 199 | #define LQ035Q1_SPIDEV_PM_OPS NULL |
192 | # define lq035q1_spidev_resume NULL | ||
193 | #endif | 200 | #endif |
194 | 201 | ||
195 | /* Power down all displays on reboot, poweroff or halt */ | 202 | /* Power down all displays on reboot, poweroff or halt */ |
@@ -708,8 +715,7 @@ static int bfin_lq035q1_probe(struct platform_device *pdev) | |||
708 | info->spidrv.probe = lq035q1_spidev_probe; | 715 | info->spidrv.probe = lq035q1_spidev_probe; |
709 | info->spidrv.remove = lq035q1_spidev_remove; | 716 | info->spidrv.remove = lq035q1_spidev_remove; |
710 | info->spidrv.shutdown = lq035q1_spidev_shutdown; | 717 | info->spidrv.shutdown = lq035q1_spidev_shutdown; |
711 | info->spidrv.suspend = lq035q1_spidev_suspend; | 718 | info->spidrv.driver.pm = LQ035Q1_SPIDEV_PM_OPS; |
712 | info->spidrv.resume = lq035q1_spidev_resume; | ||
713 | 719 | ||
714 | ret = spi_register_driver(&info->spidrv); | 720 | ret = spi_register_driver(&info->spidrv); |
715 | if (ret < 0) { | 721 | if (ret < 0) { |