mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
pwm: atmel-tcb: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions
This macro has the advantage over SIMPLE_DEV_PM_OPS that we don't have to care about when the functions are actually used, so the corresponding #ifdef can be dropped. Also make use of pm_ptr() to discard all PM related stuff if CONFIG_PM isn't enabled. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
parent
ded38f874e
commit
a7bab37f87
1 changed files with 3 additions and 5 deletions
|
@ -489,7 +489,6 @@ static const struct of_device_id atmel_tcb_pwm_dt_ids[] = {
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(of, atmel_tcb_pwm_dt_ids);
|
MODULE_DEVICE_TABLE(of, atmel_tcb_pwm_dt_ids);
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
|
||||||
static int atmel_tcb_pwm_suspend(struct device *dev)
|
static int atmel_tcb_pwm_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct atmel_tcb_pwm_chip *tcbpwm = dev_get_drvdata(dev);
|
struct atmel_tcb_pwm_chip *tcbpwm = dev_get_drvdata(dev);
|
||||||
|
@ -522,16 +521,15 @@ static int atmel_tcb_pwm_resume(struct device *dev)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static SIMPLE_DEV_PM_OPS(atmel_tcb_pwm_pm_ops, atmel_tcb_pwm_suspend,
|
static DEFINE_SIMPLE_DEV_PM_OPS(atmel_tcb_pwm_pm_ops, atmel_tcb_pwm_suspend,
|
||||||
atmel_tcb_pwm_resume);
|
atmel_tcb_pwm_resume);
|
||||||
|
|
||||||
static struct platform_driver atmel_tcb_pwm_driver = {
|
static struct platform_driver atmel_tcb_pwm_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "atmel-tcb-pwm",
|
.name = "atmel-tcb-pwm",
|
||||||
.of_match_table = atmel_tcb_pwm_dt_ids,
|
.of_match_table = atmel_tcb_pwm_dt_ids,
|
||||||
.pm = &atmel_tcb_pwm_pm_ops,
|
.pm = pm_ptr(&atmel_tcb_pwm_pm_ops),
|
||||||
},
|
},
|
||||||
.probe = atmel_tcb_pwm_probe,
|
.probe = atmel_tcb_pwm_probe,
|
||||||
.remove_new = atmel_tcb_pwm_remove,
|
.remove_new = atmel_tcb_pwm_remove,
|
||||||
|
|
Loading…
Add table
Reference in a new issue