Linux Kernels

pwm: pwm-tiehrpwm: add CONFIG_PM_SLEEP to suspend/resume functions

This change “pwm: pwm-tiehrpwm: add CONFIG_PM_SLEEP to suspend/resume functions” (commit 29258b2) in Linux kernel is authored by Jingoo Han <jg1.han [at] samsung.com> on Mon Mar 11 11:14:41 2013 +0900.

Description of "pwm: pwm-tiehrpwm: add CONFIG_PM_SLEEP to suspend/resume functions"

The change “pwm: pwm-tiehrpwm: add CONFIG_PM_SLEEP to suspend/resume functions” introduces changes as follows.

pwm: pwm-tiehrpwm: add CONFIG_PM_SLEEP to suspend/resume functions

This patch adds CONFIG_PM_SLEEP to suspend/resume functions to fix
the following build warning when CONFIG_PM_SLEEP is not selected.

drivers/pwm/pwm-tiehrpwm.c:562:12: warning: 'ehrpwm_pwm_suspend' defined but not used [-Wunused-function]
drivers/pwm/pwm-tiehrpwm.c:580:12: warning: 'ehrpwm_pwm_resume' defined but not used [-Wunused-function

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>

Linux kernel releases containing commit 29258b2

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "pwm: pwm-tiehrpwm: add CONFIG_PM_SLEEP to suspend/resume functions"

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/pwm/pwm-tiehrpwm.c | 2 ++
 1 file changed, 2 insertions(+)
 
diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
index 8b4c86fa99c8..d058ba90845b 100644
--- a/drivers/pwm/pwm-tiehrpwm.c
+++ b/drivers/pwm/pwm-tiehrpwm.c
@@ -559,6 +559,7 @@ void ehrpwm_pwm_restore_context(struct ehrpwm_pwm_chip *pc)
 	ehrpwm_write(pc->mmio_base, TBCTL, pc->ctx.tbctl);
 }
 
+#ifdef CONFIG_PM_SLEEP
 static int ehrpwm_pwm_suspend(struct device *dev)
 {
 	struct ehrpwm_pwm_chip *pc = dev_get_drvdata(dev);
@@ -594,6 +595,7 @@ static int ehrpwm_pwm_resume(struct device *dev)
 	ehrpwm_pwm_restore_context(pc);
 	return 0;
 }
+#endif
 
 static SIMPLE_DEV_PM_OPS(ehrpwm_pwm_pm_ops, ehrpwm_pwm_suspend,
 		ehrpwm_pwm_resume);

The commit for this change in Linux stable tree is 29258b2 (patch).

Last modified: 2020/01/11 09:36