diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:17:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:16 -0400 |
commit | 14c1b778fe93c79ebcb0dc42c62815615517e975 (patch) | |
tree | 838dc74de2bba69a65dee7d9acc506a540deb015 /drivers/video/backlight/adp5520_bl.c | |
parent | d50d7ac08b8330a6164c2a4b3ecd305f89e1fae8 (diff) |
backlight: adp5520: convert adp5520_bl 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>
Diffstat (limited to 'drivers/video/backlight/adp5520_bl.c')
-rw-r--r-- | drivers/video/backlight/adp5520_bl.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c index a1e41d4faa71..962d120f6d0d 100644 --- a/drivers/video/backlight/adp5520_bl.c +++ b/drivers/video/backlight/adp5520_bl.c | |||
@@ -349,35 +349,34 @@ static int adp5520_bl_remove(struct platform_device *pdev) | |||
349 | return 0; | 349 | return 0; |
350 | } | 350 | } |
351 | 351 | ||
352 | #ifdef CONFIG_PM | 352 | #ifdef CONFIG_PM_SLEEP |
353 | static int adp5520_bl_suspend(struct platform_device *pdev, | 353 | static int adp5520_bl_suspend(struct device *dev) |
354 | pm_message_t state) | ||
355 | { | 354 | { |
356 | struct backlight_device *bl = platform_get_drvdata(pdev); | 355 | struct backlight_device *bl = dev_get_drvdata(dev); |
356 | |||
357 | return adp5520_bl_set(bl, 0); | 357 | return adp5520_bl_set(bl, 0); |
358 | } | 358 | } |
359 | 359 | ||
360 | static int adp5520_bl_resume(struct platform_device *pdev) | 360 | static int adp5520_bl_resume(struct device *dev) |
361 | { | 361 | { |
362 | struct backlight_device *bl = platform_get_drvdata(pdev); | 362 | struct backlight_device *bl = dev_get_drvdata(dev); |
363 | 363 | ||
364 | backlight_update_status(bl); | 364 | backlight_update_status(bl); |
365 | return 0; | 365 | return 0; |
366 | } | 366 | } |
367 | #else | ||
368 | #define adp5520_bl_suspend NULL | ||
369 | #define adp5520_bl_resume NULL | ||
370 | #endif | 367 | #endif |
371 | 368 | ||
369 | static SIMPLE_DEV_PM_OPS(adp5520_bl_pm_ops, adp5520_bl_suspend, | ||
370 | adp5520_bl_resume); | ||
371 | |||
372 | static struct platform_driver adp5520_bl_driver = { | 372 | static struct platform_driver adp5520_bl_driver = { |
373 | .driver = { | 373 | .driver = { |
374 | .name = "adp5520-backlight", | 374 | .name = "adp5520-backlight", |
375 | .owner = THIS_MODULE, | 375 | .owner = THIS_MODULE, |
376 | .pm = &adp5520_bl_pm_ops, | ||
376 | }, | 377 | }, |
377 | .probe = adp5520_bl_probe, | 378 | .probe = adp5520_bl_probe, |
378 | .remove = adp5520_bl_remove, | 379 | .remove = adp5520_bl_remove, |
379 | .suspend = adp5520_bl_suspend, | ||
380 | .resume = adp5520_bl_resume, | ||
381 | }; | 380 | }; |
382 | 381 | ||
383 | module_platform_driver(adp5520_bl_driver); | 382 | module_platform_driver(adp5520_bl_driver); |