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

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>

authored by

Lars-Peter Clausen and committed by
Tomi Valkeinen
0268d130 2c30aba2

+14 -8
+14 -8
drivers/video/bfin-lq035q1-fb.c
··· 170 170 return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); 171 171 } 172 172 173 - #ifdef CONFIG_PM 174 - static int lq035q1_spidev_suspend(struct spi_device *spi, pm_message_t state) 173 + #ifdef CONFIG_PM_SLEEP 174 + static int lq035q1_spidev_suspend(struct device *dev) 175 175 { 176 + struct spi_device *spi = to_spi_device(dev); 177 + 176 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 184 struct spi_control *ctl = spi_get_drvdata(spi); 185 + int ret; 183 186 184 187 ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode); 185 188 if (ret) ··· 190 187 191 188 return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON); 192 189 } 190 + 191 + static SIMPLE_DEV_PM_OPS(lq035q1_spidev_pm_ops, lq035q1_spidev_suspend, 192 + lq035q1_spidev_resume); 193 + #define LQ035Q1_SPIDEV_PM_OPS (&lq035q1_spidev_pm_ops) 194 + 193 195 #else 194 - # define lq035q1_spidev_suspend NULL 195 - # define lq035q1_spidev_resume NULL 196 + #define LQ035Q1_SPIDEV_PM_OPS NULL 196 197 #endif 197 198 198 199 /* Power down all displays on reboot, poweroff or halt */ ··· 715 708 info->spidrv.probe = lq035q1_spidev_probe; 716 709 info->spidrv.remove = lq035q1_spidev_remove; 717 710 info->spidrv.shutdown = lq035q1_spidev_shutdown; 718 - info->spidrv.suspend = lq035q1_spidev_suspend; 719 - info->spidrv.resume = lq035q1_spidev_resume; 711 + info->spidrv.driver.pm = LQ035Q1_SPIDEV_PM_OPS; 720 712 721 713 ret = spi_register_driver(&info->spidrv); 722 714 if (ret < 0) {