Commit 3e14e689 authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds

backlight: tdo24m: convert tdo24m 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 a71ed77b
...@@ -412,25 +412,24 @@ static int tdo24m_remove(struct spi_device *spi) ...@@ -412,25 +412,24 @@ static int tdo24m_remove(struct spi_device *spi)
return 0; return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int tdo24m_suspend(struct spi_device *spi, pm_message_t state) static int tdo24m_suspend(struct device *dev)
{ {
struct tdo24m *lcd = spi_get_drvdata(spi); struct tdo24m *lcd = dev_get_drvdata(dev);
return tdo24m_power(lcd, FB_BLANK_POWERDOWN); return tdo24m_power(lcd, FB_BLANK_POWERDOWN);
} }
static int tdo24m_resume(struct spi_device *spi) static int tdo24m_resume(struct device *dev)
{ {
struct tdo24m *lcd = spi_get_drvdata(spi); struct tdo24m *lcd = dev_get_drvdata(dev);
return tdo24m_power(lcd, FB_BLANK_UNBLANK); return tdo24m_power(lcd, FB_BLANK_UNBLANK);
} }
#else
#define tdo24m_suspend NULL
#define tdo24m_resume NULL
#endif #endif
static SIMPLE_DEV_PM_OPS(tdo24m_pm_ops, tdo24m_suspend, tdo24m_resume);
/* Power down all displays on reboot, poweroff or halt */ /* Power down all displays on reboot, poweroff or halt */
static void tdo24m_shutdown(struct spi_device *spi) static void tdo24m_shutdown(struct spi_device *spi)
{ {
...@@ -443,12 +442,11 @@ static struct spi_driver tdo24m_driver = { ...@@ -443,12 +442,11 @@ static struct spi_driver tdo24m_driver = {
.driver = { .driver = {
.name = "tdo24m", .name = "tdo24m",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &tdo24m_pm_ops,
}, },
.probe = tdo24m_probe, .probe = tdo24m_probe,
.remove = tdo24m_remove, .remove = tdo24m_remove,
.shutdown = tdo24m_shutdown, .shutdown = tdo24m_shutdown,
.suspend = tdo24m_suspend,
.resume = tdo24m_resume,
}; };
module_spi_driver(tdo24m_driver); module_spi_driver(tdo24m_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