mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-28 20:02:17 +00:00
backlight: lm3533_bl: convert lm3533_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>
This commit is contained in:
parent
f10a46cfe0
commit
b079296259
1 changed files with 10 additions and 12 deletions
|
@ -368,29 +368,28 @@ static int lm3533_bl_remove(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM_SLEEP
|
||||||
static int lm3533_bl_suspend(struct platform_device *pdev, pm_message_t state)
|
static int lm3533_bl_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct lm3533_bl *bl = platform_get_drvdata(pdev);
|
struct lm3533_bl *bl = dev_get_drvdata(dev);
|
||||||
|
|
||||||
dev_dbg(&pdev->dev, "%s\n", __func__);
|
dev_dbg(dev, "%s\n", __func__);
|
||||||
|
|
||||||
return lm3533_ctrlbank_disable(&bl->cb);
|
return lm3533_ctrlbank_disable(&bl->cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lm3533_bl_resume(struct platform_device *pdev)
|
static int lm3533_bl_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct lm3533_bl *bl = platform_get_drvdata(pdev);
|
struct lm3533_bl *bl = dev_get_drvdata(dev);
|
||||||
|
|
||||||
dev_dbg(&pdev->dev, "%s\n", __func__);
|
dev_dbg(dev, "%s\n", __func__);
|
||||||
|
|
||||||
return lm3533_ctrlbank_enable(&bl->cb);
|
return lm3533_ctrlbank_enable(&bl->cb);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#define lm3533_bl_suspend NULL
|
|
||||||
#define lm3533_bl_resume NULL
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(lm3533_bl_pm_ops, lm3533_bl_suspend, lm3533_bl_resume);
|
||||||
|
|
||||||
static void lm3533_bl_shutdown(struct platform_device *pdev)
|
static void lm3533_bl_shutdown(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct lm3533_bl *bl = platform_get_drvdata(pdev);
|
struct lm3533_bl *bl = platform_get_drvdata(pdev);
|
||||||
|
@ -404,12 +403,11 @@ static struct platform_driver lm3533_bl_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "lm3533-backlight",
|
.name = "lm3533-backlight",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
.pm = &lm3533_bl_pm_ops,
|
||||||
},
|
},
|
||||||
.probe = lm3533_bl_probe,
|
.probe = lm3533_bl_probe,
|
||||||
.remove = lm3533_bl_remove,
|
.remove = lm3533_bl_remove,
|
||||||
.shutdown = lm3533_bl_shutdown,
|
.shutdown = lm3533_bl_shutdown,
|
||||||
.suspend = lm3533_bl_suspend,
|
|
||||||
.resume = lm3533_bl_resume,
|
|
||||||
};
|
};
|
||||||
module_platform_driver(lm3533_bl_driver);
|
module_platform_driver(lm3533_bl_driver);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue