Commit ba3601a9 authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds

drivers/video/backlight/ams369fg06.c: convert ams369fg06 to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a16b945c
...@@ -533,12 +533,12 @@ static int ams369fg06_remove(struct spi_device *spi) ...@@ -533,12 +533,12 @@ static int ams369fg06_remove(struct spi_device *spi)
return 0; return 0;
} }
#if defined(CONFIG_PM) #ifdef CONFIG_PM_SLEEP
static int ams369fg06_suspend(struct spi_device *spi, pm_message_t mesg) static int ams369fg06_suspend(struct device *dev)
{ {
struct ams369fg06 *lcd = spi_get_drvdata(spi); struct ams369fg06 *lcd = dev_get_drvdata(dev);
dev_dbg(&spi->dev, "lcd->power = %d\n", lcd->power); dev_dbg(dev, "lcd->power = %d\n", lcd->power);
/* /*
* when lcd panel is suspend, lcd panel becomes off * when lcd panel is suspend, lcd panel becomes off
...@@ -547,19 +547,19 @@ static int ams369fg06_suspend(struct spi_device *spi, pm_message_t mesg) ...@@ -547,19 +547,19 @@ static int ams369fg06_suspend(struct spi_device *spi, pm_message_t mesg)
return ams369fg06_power(lcd, FB_BLANK_POWERDOWN); return ams369fg06_power(lcd, FB_BLANK_POWERDOWN);
} }
static int ams369fg06_resume(struct spi_device *spi) static int ams369fg06_resume(struct device *dev)
{ {
struct ams369fg06 *lcd = spi_get_drvdata(spi); struct ams369fg06 *lcd = dev_get_drvdata(dev);
lcd->power = FB_BLANK_POWERDOWN; lcd->power = FB_BLANK_POWERDOWN;
return ams369fg06_power(lcd, FB_BLANK_UNBLANK); return ams369fg06_power(lcd, FB_BLANK_UNBLANK);
} }
#else
#define ams369fg06_suspend NULL
#define ams369fg06_resume NULL
#endif #endif
static SIMPLE_DEV_PM_OPS(ams369fg06_pm_ops, ams369fg06_suspend,
ams369fg06_resume);
static void ams369fg06_shutdown(struct spi_device *spi) static void ams369fg06_shutdown(struct spi_device *spi)
{ {
struct ams369fg06 *lcd = spi_get_drvdata(spi); struct ams369fg06 *lcd = spi_get_drvdata(spi);
...@@ -571,12 +571,11 @@ static struct spi_driver ams369fg06_driver = { ...@@ -571,12 +571,11 @@ static struct spi_driver ams369fg06_driver = {
.driver = { .driver = {
.name = "ams369fg06", .name = "ams369fg06",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &ams369fg06_pm_ops,
}, },
.probe = ams369fg06_probe, .probe = ams369fg06_probe,
.remove = ams369fg06_remove, .remove = ams369fg06_remove,
.shutdown = ams369fg06_shutdown, .shutdown = ams369fg06_shutdown,
.suspend = ams369fg06_suspend,
.resume = ams369fg06_resume,
}; };
module_spi_driver(ams369fg06_driver); module_spi_driver(ams369fg06_driver);
......
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