clocksource/drivers/ingenic-timer: Use pm_sleep_ptr() macro
The use of the pm_sleep_ptr() macro allows the compiler to always see the dev_pm_ops structure and related functions, while still allowing the unused code to be removed, without the need for the __maybe_unused markings. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20230618153937.96649-1-paul@crapouillou.net
This commit is contained in:
parent
2951580ba6
commit
ea95051063
|
@ -369,7 +369,7 @@ static int __init ingenic_tcu_probe(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __maybe_unused ingenic_tcu_suspend(struct device *dev)
|
static int ingenic_tcu_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct ingenic_tcu *tcu = dev_get_drvdata(dev);
|
struct ingenic_tcu *tcu = dev_get_drvdata(dev);
|
||||||
unsigned int cpu;
|
unsigned int cpu;
|
||||||
|
@ -382,7 +382,7 @@ static int __maybe_unused ingenic_tcu_suspend(struct device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __maybe_unused ingenic_tcu_resume(struct device *dev)
|
static int ingenic_tcu_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct ingenic_tcu *tcu = dev_get_drvdata(dev);
|
struct ingenic_tcu *tcu = dev_get_drvdata(dev);
|
||||||
unsigned int cpu;
|
unsigned int cpu;
|
||||||
|
@ -406,7 +406,7 @@ err_timer_clk_disable:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct dev_pm_ops __maybe_unused ingenic_tcu_pm_ops = {
|
static const struct dev_pm_ops ingenic_tcu_pm_ops = {
|
||||||
/* _noirq: We want the TCU clocks to be gated last / ungated first */
|
/* _noirq: We want the TCU clocks to be gated last / ungated first */
|
||||||
.suspend_noirq = ingenic_tcu_suspend,
|
.suspend_noirq = ingenic_tcu_suspend,
|
||||||
.resume_noirq = ingenic_tcu_resume,
|
.resume_noirq = ingenic_tcu_resume,
|
||||||
|
@ -415,9 +415,7 @@ static const struct dev_pm_ops __maybe_unused ingenic_tcu_pm_ops = {
|
||||||
static struct platform_driver ingenic_tcu_driver = {
|
static struct platform_driver ingenic_tcu_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "ingenic-tcu-timer",
|
.name = "ingenic-tcu-timer",
|
||||||
#ifdef CONFIG_PM_SLEEP
|
.pm = pm_sleep_ptr(&ingenic_tcu_pm_ops),
|
||||||
.pm = &ingenic_tcu_pm_ops,
|
|
||||||
#endif
|
|
||||||
.of_match_table = ingenic_tcu_of_match,
|
.of_match_table = ingenic_tcu_of_match,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue