Commit 5a3778e2 authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds

backlight: locomolcd: convert locomolcd 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 b0792962
...@@ -157,25 +157,24 @@ static const struct backlight_ops locomobl_data = { ...@@ -157,25 +157,24 @@ static const struct backlight_ops locomobl_data = {
.update_status = locomolcd_set_intensity, .update_status = locomolcd_set_intensity,
}; };
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int locomolcd_suspend(struct locomo_dev *dev, pm_message_t state) static int locomolcd_suspend(struct device *dev)
{ {
locomolcd_flags |= LOCOMOLCD_SUSPENDED; locomolcd_flags |= LOCOMOLCD_SUSPENDED;
locomolcd_set_intensity(locomolcd_bl_device); locomolcd_set_intensity(locomolcd_bl_device);
return 0; return 0;
} }
static int locomolcd_resume(struct locomo_dev *dev) static int locomolcd_resume(struct device *dev)
{ {
locomolcd_flags &= ~LOCOMOLCD_SUSPENDED; locomolcd_flags &= ~LOCOMOLCD_SUSPENDED;
locomolcd_set_intensity(locomolcd_bl_device); locomolcd_set_intensity(locomolcd_bl_device);
return 0; return 0;
} }
#else
#define locomolcd_suspend NULL
#define locomolcd_resume NULL
#endif #endif
static SIMPLE_DEV_PM_OPS(locomolcd_pm_ops, locomolcd_suspend, locomolcd_resume);
static int locomolcd_probe(struct locomo_dev *ldev) static int locomolcd_probe(struct locomo_dev *ldev)
{ {
struct backlight_properties props; struct backlight_properties props;
...@@ -230,13 +229,12 @@ static int locomolcd_remove(struct locomo_dev *dev) ...@@ -230,13 +229,12 @@ static int locomolcd_remove(struct locomo_dev *dev)
static struct locomo_driver poodle_lcd_driver = { static struct locomo_driver poodle_lcd_driver = {
.drv = { .drv = {
.name = "locomo-backlight", .name = "locomo-backlight",
.pm = &locomolcd_pm_ops,
}, },
.devid = LOCOMO_DEVID_BACKLIGHT, .devid = LOCOMO_DEVID_BACKLIGHT,
.probe = locomolcd_probe, .probe = locomolcd_probe,
.remove = locomolcd_remove, .remove = locomolcd_remove,
.suspend = locomolcd_suspend,
.resume = locomolcd_resume,
}; };
static int __init locomolcd_init(void) static int __init locomolcd_init(void)
......
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