backlight: pwm_bl: Use SIMPLE_DEV_PM_OPS()
Subsystems (3)
PATCH v2 1/1 backlight: pwm_bl: Use SIMPLE_DEV_PM_OPS()
Use the SIMPLE_DEV_PM_OPS() macro to declare the driver's pm_ops. As a side effect, removing #ifdef CONFIG_PM_SLEEP will improve compilation coverage.
Signed-off-by Alexander Shiyan <[email protected]>
--- drivers/video/backlight/pwm_bl.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/video/backlight/pwm_bl.c +4 -12
@@ -673,8 +673,7 @@ static void pwm_backlight_shutdown(struct platform_device *pdev)pwm_backlight_power_off (pb); } -#ifdef CONFIG_PM_SLEEP -static int pwm_backlight_suspend (struct device *dev) +static int __maybe_unused pwm_backlight_suspend (struct device *dev) {struct backlight_device *bl =dev_get_drvdata (dev);struct pwm_bl_data *pb =bl_get_data (bl);
@@ -690,7 +689,7 @@ static int pwm_backlight_suspend(struct device *dev)return 0 ; } -static int pwm_backlight_resume (struct device *dev) +static int __maybe_unused pwm_backlight_resume (struct device *dev) {struct backlight_device *bl =dev_get_drvdata (dev);
@@ -698,16 +697,9 @@ static int pwm_backlight_resume(struct device *dev)return 0 ; } -#endif -static const struct dev_pm_ops pwm_backlight_pm_ops = { -#ifdef CONFIG_PM_SLEEP - .suspend = pwm_backlight_suspend, - .resume = pwm_backlight_resume, - .poweroff = pwm_backlight_suspend, - .restore = pwm_backlight_resume, -#endif -}; +static SIMPLE_DEV_PM_OPS(pwm_backlight_pm_ops, + pwm_backlight_suspend, pwm_backlight_resume);static struct platform_driver pwm_backlight_driver = { .driver = {
Signature · 1 line
2.10.2
Quoted 3 lines · Alexander Shiyan
Use the
SIMPLE_DEV_PM_OPS()macro to declare the driver'spm_ops. As a side effect, removing #ifdefCONFIG_PM_SLEEPwill improve compilation coverage.
Adopting SIMPLE_DEV_PM_OPS() results in the suspend/resume functions being called during a freeze/thaw. Is turning off the backlight during a freeze really necessary?
Quoted 3 lines
Signed-off-by Alexander Shiyan <[email protected]>---
Summary of changes since v1 would be useful here. For single patches you can use git annotate and the corresponding argument to format-patch to handle the change log.
Quoted 48 lines
drivers/video/backlight/pwm_bl.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)drivers/video/backlight/pwm_bl.c +4
-12@@ -673,8 +673,7 @@ static void pwm_backlight_shutdown(struct platform_device *pdev)pwm_backlight_power_off (pb); } -#ifdef CONFIG_PM_SLEEP -static int pwm_backlight_suspend (struct device *dev) +static int __maybe_unused pwm_backlight_suspend (struct device *dev) {struct backlight_device *bl =dev_get_drvdata (dev);struct pwm_bl_data *pb =bl_get_data (bl);@@ -690,7 +689,7 @@ static int pwm_backlight_suspend(struct device *dev)return 0 ; } -static int pwm_backlight_resume (struct device *dev) +static int __maybe_unused pwm_backlight_resume (struct device *dev) {struct backlight_device *bl =dev_get_drvdata (dev);@@ -698,16 +697,9 @@ static int pwm_backlight_resume(struct device *dev)return 0 ; } -#endif -static const struct dev_pm_ops pwm_backlight_pm_ops = { -#ifdef CONFIG_PM_SLEEP - .suspend = pwm_backlight_suspend, - .resume = pwm_backlight_resume, - .poweroff = pwm_backlight_suspend, - .restore = pwm_backlight_resume, -#endif -}; +static SIMPLE_DEV_PM_OPS(pwm_backlight_pm_ops, + pwm_backlight_suspend, pwm_backlight_resume);static struct platform_driver pwm_backlight_driver = { .driver = {Signature · 1 line
2.10.2