diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:17:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:16 -0400 |
commit | b55bb78d296731d68bf14244b1c471dc2575bb3d (patch) | |
tree | 6d2ef1dfa463159e3eb42a7ba2839ff15eafd08f /drivers/video/backlight | |
parent | d7696aad5daed5e361bb57128db136f1d4ad33e0 (diff) |
backlight: hp680_bl: convert hp680bl 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')
-rw-r--r-- | drivers/video/backlight/hp680_bl.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/video/backlight/hp680_bl.c b/drivers/video/backlight/hp680_bl.c index 5cefd73526f8..00076ecfe9b8 100644 --- a/drivers/video/backlight/hp680_bl.c +++ b/drivers/video/backlight/hp680_bl.c | |||
@@ -64,29 +64,28 @@ static void hp680bl_send_intensity(struct backlight_device *bd) | |||
64 | } | 64 | } |
65 | 65 | ||
66 | 66 | ||
67 | #ifdef CONFIG_PM | 67 | #ifdef CONFIG_PM_SLEEP |
68 | static int hp680bl_suspend(struct platform_device *pdev, pm_message_t state) | 68 | static int hp680bl_suspend(struct device *dev) |
69 | { | 69 | { |
70 | struct backlight_device *bd = platform_get_drvdata(pdev); | 70 | struct backlight_device *bd = dev_get_drvdata(dev); |
71 | 71 | ||
72 | hp680bl_suspended = 1; | 72 | hp680bl_suspended = 1; |
73 | hp680bl_send_intensity(bd); | 73 | hp680bl_send_intensity(bd); |
74 | return 0; | 74 | return 0; |
75 | } | 75 | } |
76 | 76 | ||
77 | static int hp680bl_resume(struct platform_device *pdev) | 77 | static int hp680bl_resume(struct device *dev) |
78 | { | 78 | { |
79 | struct backlight_device *bd = platform_get_drvdata(pdev); | 79 | struct backlight_device *bd = dev_get_drvdata(dev); |
80 | 80 | ||
81 | hp680bl_suspended = 0; | 81 | hp680bl_suspended = 0; |
82 | hp680bl_send_intensity(bd); | 82 | hp680bl_send_intensity(bd); |
83 | return 0; | 83 | return 0; |
84 | } | 84 | } |
85 | #else | ||
86 | #define hp680bl_suspend NULL | ||
87 | #define hp680bl_resume NULL | ||
88 | #endif | 85 | #endif |
89 | 86 | ||
87 | static SIMPLE_DEV_PM_OPS(hp680bl_pm_ops, hp680bl_suspend, hp680bl_resume); | ||
88 | |||
90 | static int hp680bl_set_intensity(struct backlight_device *bd) | 89 | static int hp680bl_set_intensity(struct backlight_device *bd) |
91 | { | 90 | { |
92 | hp680bl_send_intensity(bd); | 91 | hp680bl_send_intensity(bd); |
@@ -140,10 +139,9 @@ static int hp680bl_remove(struct platform_device *pdev) | |||
140 | static struct platform_driver hp680bl_driver = { | 139 | static struct platform_driver hp680bl_driver = { |
141 | .probe = hp680bl_probe, | 140 | .probe = hp680bl_probe, |
142 | .remove = hp680bl_remove, | 141 | .remove = hp680bl_remove, |
143 | .suspend = hp680bl_suspend, | ||
144 | .resume = hp680bl_resume, | ||
145 | .driver = { | 142 | .driver = { |
146 | .name = "hp680-bl", | 143 | .name = "hp680-bl", |
144 | .pm = &hp680bl_pm_ops, | ||
147 | }, | 145 | }, |
148 | }; | 146 | }; |
149 | 147 | ||