summaryrefslogtreecommitdiff
path: root/drivers/video/backlight/vgg2432a4.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-30 03:18:01 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 05:28:18 +0400
commiteb39ad2558c75b43ea21a2578088ab8d63a79d92 (patch)
tree41df2fad5875988de3abb3be8376cce2ef9f335c /drivers/video/backlight/vgg2432a4.c
parent1dde37d4574cce3c0c99ddffc3623b533578be49 (diff)
downloadlinux-eb39ad2558c75b43ea21a2578088ab8d63a79d92.tar.xz
backlight: vgg2432a4: convert vgg2432a4_driver to dev_pm_ops
Instead of using legacy suspend/resume methods, using newer dev_pm_ops structure allows better control over power management. Also, use of pm_message_t is deprecated. Thus, it is removed. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/backlight/vgg2432a4.c')
-rw-r--r--drivers/video/backlight/vgg2432a4.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/video/backlight/vgg2432a4.c b/drivers/video/backlight/vgg2432a4.c
index 84d582f591dc..d538947a67d3 100644
--- a/drivers/video/backlight/vgg2432a4.c
+++ b/drivers/video/backlight/vgg2432a4.c
@@ -205,18 +205,15 @@ static int vgg2432a4_lcd_init(struct ili9320 *lcd,
return ret;
}
-#ifdef CONFIG_PM
-static int vgg2432a4_suspend(struct spi_device *spi, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+static int vgg2432a4_suspend(struct device *dev)
{
- return ili9320_suspend(spi_get_drvdata(spi), state);
+ return ili9320_suspend(dev_get_drvdata(dev));
}
-static int vgg2432a4_resume(struct spi_device *spi)
+static int vgg2432a4_resume(struct device *dev)
{
- return ili9320_resume(spi_get_drvdata(spi));
+ return ili9320_resume(dev_get_drvdata(dev));
}
-#else
-#define vgg2432a4_suspend NULL
-#define vgg2432a4_resume NULL
#endif
static struct ili9320_client vgg2432a4_client = {
@@ -249,16 +246,17 @@ static void vgg2432a4_shutdown(struct spi_device *spi)
ili9320_shutdown(spi_get_drvdata(spi));
}
+static SIMPLE_DEV_PM_OPS(vgg2432a4_pm_ops, vgg2432a4_suspend, vgg2432a4_resume);
+
static struct spi_driver vgg2432a4_driver = {
.driver = {
.name = "VGG2432A4",
.owner = THIS_MODULE,
+ .pm = &vgg2432a4_pm_ops,
},
.probe = vgg2432a4_probe,
.remove = vgg2432a4_remove,
.shutdown = vgg2432a4_shutdown,
- .suspend = vgg2432a4_suspend,
- .resume = vgg2432a4_resume,
};
module_spi_driver(vgg2432a4_driver);