Commit dacb6a40 authored by Anson Huang's avatar Anson Huang Committed by Alexandre Belloni

rtc: snvs: Use __maybe_unused instead of #if CONFIG_PM_SLEEP

Use __maybe_unused for power management related functions
instead of #if CONFIG_PM_SLEEP to simply the code.
Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
Reviewed-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 557fbf4f
...@@ -360,9 +360,7 @@ static int snvs_rtc_probe(struct platform_device *pdev) ...@@ -360,9 +360,7 @@ static int snvs_rtc_probe(struct platform_device *pdev)
return ret; return ret;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused snvs_rtc_suspend_noirq(struct device *dev)
static int snvs_rtc_suspend_noirq(struct device *dev)
{ {
struct snvs_rtc_data *data = dev_get_drvdata(dev); struct snvs_rtc_data *data = dev_get_drvdata(dev);
...@@ -372,7 +370,7 @@ static int snvs_rtc_suspend_noirq(struct device *dev) ...@@ -372,7 +370,7 @@ static int snvs_rtc_suspend_noirq(struct device *dev)
return 0; return 0;
} }
static int snvs_rtc_resume_noirq(struct device *dev) static int __maybe_unused snvs_rtc_resume_noirq(struct device *dev)
{ {
struct snvs_rtc_data *data = dev_get_drvdata(dev); struct snvs_rtc_data *data = dev_get_drvdata(dev);
...@@ -383,18 +381,9 @@ static int snvs_rtc_resume_noirq(struct device *dev) ...@@ -383,18 +381,9 @@ static int snvs_rtc_resume_noirq(struct device *dev)
} }
static const struct dev_pm_ops snvs_rtc_pm_ops = { static const struct dev_pm_ops snvs_rtc_pm_ops = {
.suspend_noirq = snvs_rtc_suspend_noirq, SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(snvs_rtc_suspend_noirq, snvs_rtc_resume_noirq)
.resume_noirq = snvs_rtc_resume_noirq,
}; };
#define SNVS_RTC_PM_OPS (&snvs_rtc_pm_ops)
#else
#define SNVS_RTC_PM_OPS NULL
#endif
static const struct of_device_id snvs_dt_ids[] = { static const struct of_device_id snvs_dt_ids[] = {
{ .compatible = "fsl,sec-v4.0-mon-rtc-lp", }, { .compatible = "fsl,sec-v4.0-mon-rtc-lp", },
{ /* sentinel */ } { /* sentinel */ }
...@@ -404,7 +393,7 @@ MODULE_DEVICE_TABLE(of, snvs_dt_ids); ...@@ -404,7 +393,7 @@ MODULE_DEVICE_TABLE(of, snvs_dt_ids);
static struct platform_driver snvs_rtc_driver = { static struct platform_driver snvs_rtc_driver = {
.driver = { .driver = {
.name = "snvs_rtc", .name = "snvs_rtc",
.pm = SNVS_RTC_PM_OPS, .pm = &snvs_rtc_pm_ops,
.of_match_table = snvs_dt_ids, .of_match_table = snvs_dt_ids,
}, },
.probe = snvs_rtc_probe, .probe = snvs_rtc_probe,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment