Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jingoo Han and committed by
Linus Torvalds
5a3778e2 b0792962

+7 -9
+7 -9
drivers/video/backlight/locomolcd.c
··· 157 157 .update_status = locomolcd_set_intensity, 158 158 }; 159 159 160 - #ifdef CONFIG_PM 161 - static int locomolcd_suspend(struct locomo_dev *dev, pm_message_t state) 160 + #ifdef CONFIG_PM_SLEEP 161 + static int locomolcd_suspend(struct device *dev) 162 162 { 163 163 locomolcd_flags |= LOCOMOLCD_SUSPENDED; 164 164 locomolcd_set_intensity(locomolcd_bl_device); 165 165 return 0; 166 166 } 167 167 168 - static int locomolcd_resume(struct locomo_dev *dev) 168 + static int locomolcd_resume(struct device *dev) 169 169 { 170 170 locomolcd_flags &= ~LOCOMOLCD_SUSPENDED; 171 171 locomolcd_set_intensity(locomolcd_bl_device); 172 172 return 0; 173 173 } 174 - #else 175 - #define locomolcd_suspend NULL 176 - #define locomolcd_resume NULL 177 174 #endif 175 + 176 + static SIMPLE_DEV_PM_OPS(locomolcd_pm_ops, locomolcd_suspend, locomolcd_resume); 178 177 179 178 static int locomolcd_probe(struct locomo_dev *ldev) 180 179 { ··· 229 230 230 231 static struct locomo_driver poodle_lcd_driver = { 231 232 .drv = { 232 - .name = "locomo-backlight", 233 + .name = "locomo-backlight", 234 + .pm = &locomolcd_pm_ops, 233 235 }, 234 236 .devid = LOCOMO_DEVID_BACKLIGHT, 235 237 .probe = locomolcd_probe, 236 238 .remove = locomolcd_remove, 237 - .suspend = locomolcd_suspend, 238 - .resume = locomolcd_resume, 239 239 }; 240 240 241 241 static int __init locomolcd_init(void)