Commit 0268d130 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Tomi Valkeinen

fbdev: bfin-lq035q1-fb: Use dev_pm_ops

Use dev_pm_ops instead of the legacy suspend/resume callbacks.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 2c30aba2
...@@ -170,16 +170,19 @@ static int lq035q1_spidev_remove(struct spi_device *spi) ...@@ -170,16 +170,19 @@ static int lq035q1_spidev_remove(struct spi_device *spi)
return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int lq035q1_spidev_suspend(struct spi_device *spi, pm_message_t state) static int lq035q1_spidev_suspend(struct device *dev)
{ {
struct spi_device *spi = to_spi_device(dev);
return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT);
} }
static int lq035q1_spidev_resume(struct spi_device *spi) static int lq035q1_spidev_resume(struct device *dev)
{ {
int ret; struct spi_device *spi = to_spi_device(dev);
struct spi_control *ctl = spi_get_drvdata(spi); struct spi_control *ctl = spi_get_drvdata(spi);
int ret;
ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode); ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode);
if (ret) if (ret)
...@@ -187,9 +190,13 @@ static int lq035q1_spidev_resume(struct spi_device *spi) ...@@ -187,9 +190,13 @@ static int lq035q1_spidev_resume(struct spi_device *spi)
return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON); return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON);
} }
static SIMPLE_DEV_PM_OPS(lq035q1_spidev_pm_ops, lq035q1_spidev_suspend,
lq035q1_spidev_resume);
#define LQ035Q1_SPIDEV_PM_OPS (&lq035q1_spidev_pm_ops)
#else #else
# define lq035q1_spidev_suspend NULL #define LQ035Q1_SPIDEV_PM_OPS NULL
# define lq035q1_spidev_resume NULL
#endif #endif
/* Power down all displays on reboot, poweroff or halt */ /* Power down all displays on reboot, poweroff or halt */
...@@ -708,8 +715,7 @@ static int bfin_lq035q1_probe(struct platform_device *pdev) ...@@ -708,8 +715,7 @@ static int bfin_lq035q1_probe(struct platform_device *pdev)
info->spidrv.probe = lq035q1_spidev_probe; info->spidrv.probe = lq035q1_spidev_probe;
info->spidrv.remove = lq035q1_spidev_remove; info->spidrv.remove = lq035q1_spidev_remove;
info->spidrv.shutdown = lq035q1_spidev_shutdown; info->spidrv.shutdown = lq035q1_spidev_shutdown;
info->spidrv.suspend = lq035q1_spidev_suspend; info->spidrv.driver.pm = LQ035Q1_SPIDEV_PM_OPS;
info->spidrv.resume = lq035q1_spidev_resume;
ret = spi_register_driver(&info->spidrv); ret = spi_register_driver(&info->spidrv);
if (ret < 0) { if (ret < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment