aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/backlight/pwm_bl.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index b811e8fb4062..7496d04e1d3c 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -169,10 +169,9 @@ static int pwm_backlight_remove(struct platform_device *pdev)
169} 169}
170 170
171#ifdef CONFIG_PM 171#ifdef CONFIG_PM
172static int pwm_backlight_suspend(struct platform_device *pdev, 172static int pwm_backlight_suspend(struct device *dev)
173 pm_message_t state)
174{ 173{
175 struct backlight_device *bl = platform_get_drvdata(pdev); 174 struct backlight_device *bl = dev_get_drvdata(dev);
176 struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); 175 struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev);
177 176
178 if (pb->notify) 177 if (pb->notify)
@@ -184,27 +183,29 @@ static int pwm_backlight_suspend(struct platform_device *pdev,
184 return 0; 183 return 0;
185} 184}
186 185
187static int pwm_backlight_resume(struct platform_device *pdev) 186static int pwm_backlight_resume(struct device *dev)
188{ 187{
189 struct backlight_device *bl = platform_get_drvdata(pdev); 188 struct backlight_device *bl = dev_get_drvdata(dev);
190 189
191 backlight_update_status(bl); 190 backlight_update_status(bl);
192 return 0; 191 return 0;
193} 192}
194#else 193
195#define pwm_backlight_suspend NULL 194static SIMPLE_DEV_PM_OPS(pwm_backlight_pm_ops, pwm_backlight_suspend,
196#define pwm_backlight_resume NULL 195 pwm_backlight_resume);
196
197#endif 197#endif
198 198
199static struct platform_driver pwm_backlight_driver = { 199static struct platform_driver pwm_backlight_driver = {
200 .driver = { 200 .driver = {
201 .name = "pwm-backlight", 201 .name = "pwm-backlight",
202 .owner = THIS_MODULE, 202 .owner = THIS_MODULE,
203#ifdef CONFIG_PM
204 .pm = &pwm_backlight_pm_ops,
205#endif
203 }, 206 },
204 .probe = pwm_backlight_probe, 207 .probe = pwm_backlight_probe,
205 .remove = pwm_backlight_remove, 208 .remove = pwm_backlight_remove,
206 .suspend = pwm_backlight_suspend,
207 .resume = pwm_backlight_resume,
208}; 209};
209 210
210module_platform_driver(pwm_backlight_driver); 211module_platform_driver(pwm_backlight_driver);