提交 e2c17bc6 编写于 作者: M Mark Brown 提交者: Linus Torvalds

backlight: convert pwm_bl to dev_pm_ops

Should be no functional changes, mainly a reorganisation to support future
work.

[akpm@linux-foundation.org: fix CONFIG_PM=n build]
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 48e78e8c
...@@ -169,10 +169,9 @@ static int pwm_backlight_remove(struct platform_device *pdev) ...@@ -169,10 +169,9 @@ static int pwm_backlight_remove(struct platform_device *pdev)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int pwm_backlight_suspend(struct platform_device *pdev, static int pwm_backlight_suspend(struct device *dev)
pm_message_t state)
{ {
struct backlight_device *bl = platform_get_drvdata(pdev); struct backlight_device *bl = dev_get_drvdata(dev);
struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev);
if (pb->notify) if (pb->notify)
...@@ -184,27 +183,29 @@ static int pwm_backlight_suspend(struct platform_device *pdev, ...@@ -184,27 +183,29 @@ static int pwm_backlight_suspend(struct platform_device *pdev,
return 0; return 0;
} }
static int pwm_backlight_resume(struct platform_device *pdev) static int pwm_backlight_resume(struct device *dev)
{ {
struct backlight_device *bl = platform_get_drvdata(pdev); struct backlight_device *bl = dev_get_drvdata(dev);
backlight_update_status(bl); backlight_update_status(bl);
return 0; return 0;
} }
#else
#define pwm_backlight_suspend NULL static SIMPLE_DEV_PM_OPS(pwm_backlight_pm_ops, pwm_backlight_suspend,
#define pwm_backlight_resume NULL pwm_backlight_resume);
#endif #endif
static struct platform_driver pwm_backlight_driver = { static struct platform_driver pwm_backlight_driver = {
.driver = { .driver = {
.name = "pwm-backlight", .name = "pwm-backlight",
.owner = THIS_MODULE, .owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &pwm_backlight_pm_ops,
#endif
}, },
.probe = pwm_backlight_probe, .probe = pwm_backlight_probe,
.remove = pwm_backlight_remove, .remove = pwm_backlight_remove,
.suspend = pwm_backlight_suspend,
.resume = pwm_backlight_resume,
}; };
module_platform_driver(pwm_backlight_driver); module_platform_driver(pwm_backlight_driver);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册