backlight: ep93xx: convert ep93xx 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>
This commit is contained in:
parent
bb07471057
commit
d7696aad5d
|
@ -115,35 +115,33 @@ static int ep93xxbl_remove(struct platform_device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM_SLEEP
|
||||||
static int ep93xxbl_suspend(struct platform_device *dev, pm_message_t state)
|
static int ep93xxbl_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct backlight_device *bl = platform_get_drvdata(dev);
|
struct backlight_device *bl = dev_get_drvdata(dev);
|
||||||
|
|
||||||
return ep93xxbl_set(bl, 0);
|
return ep93xxbl_set(bl, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ep93xxbl_resume(struct platform_device *dev)
|
static int ep93xxbl_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct backlight_device *bl = platform_get_drvdata(dev);
|
struct backlight_device *bl = dev_get_drvdata(dev);
|
||||||
|
|
||||||
backlight_update_status(bl);
|
backlight_update_status(bl);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#define ep93xxbl_suspend NULL
|
|
||||||
#define ep93xxbl_resume NULL
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(ep93xxbl_pm_ops, ep93xxbl_suspend, ep93xxbl_resume);
|
||||||
|
|
||||||
static struct platform_driver ep93xxbl_driver = {
|
static struct platform_driver ep93xxbl_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "ep93xx-bl",
|
.name = "ep93xx-bl",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
.pm = &ep93xxbl_pm_ops,
|
||||||
},
|
},
|
||||||
.probe = ep93xxbl_probe,
|
.probe = ep93xxbl_probe,
|
||||||
.remove = ep93xxbl_remove,
|
.remove = ep93xxbl_remove,
|
||||||
.suspend = ep93xxbl_suspend,
|
|
||||||
.resume = ep93xxbl_resume,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module_platform_driver(ep93xxbl_driver);
|
module_platform_driver(ep93xxbl_driver);
|
||||||
|
|
Loading…
Reference in New Issue