Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clocksource/drivers/ingenic-ost: Define pm functions properly in platform_driver struct

Commit ca7b72b5a5f2 ("clocksource: Add driver for the Ingenic JZ47xx OST")
adds the struct platform_driver ingenic_ost_driver, with the definition of
pm functions under the non-existing config PM_SUSPEND, which means the
intended pm functions were never actually included in any build.

As the only callbacks are .suspend_noirq and .resume_noirq, we can assume
that it is intended to be CONFIG_PM_SLEEP.

Since commit 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate
old ones"), the default pattern for platform_driver definitions
conditional for CONFIG_PM_SLEEP is to use pm_sleep_ptr().

As __maybe_unused annotations on the dev_pm_ops structure and its callbacks
are not needed anymore, remove these as well.

Suggested-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20221123083159.22821-1-lukas.bulwahn@gmail.com

authored by

Lukas Bulwahn and committed by
Thomas Gleixner
03562954 3f44f715

+4 -6
+4 -6
drivers/clocksource/ingenic-ost.c
··· 141 141 return 0; 142 142 } 143 143 144 - static int __maybe_unused ingenic_ost_suspend(struct device *dev) 144 + static int ingenic_ost_suspend(struct device *dev) 145 145 { 146 146 struct ingenic_ost *ost = dev_get_drvdata(dev); 147 147 ··· 150 150 return 0; 151 151 } 152 152 153 - static int __maybe_unused ingenic_ost_resume(struct device *dev) 153 + static int ingenic_ost_resume(struct device *dev) 154 154 { 155 155 struct ingenic_ost *ost = dev_get_drvdata(dev); 156 156 157 157 return clk_enable(ost->clk); 158 158 } 159 159 160 - static const struct dev_pm_ops __maybe_unused ingenic_ost_pm_ops = { 160 + static const struct dev_pm_ops ingenic_ost_pm_ops = { 161 161 /* _noirq: We want the OST clock to be gated last / ungated first */ 162 162 .suspend_noirq = ingenic_ost_suspend, 163 163 .resume_noirq = ingenic_ost_resume, ··· 181 181 static struct platform_driver ingenic_ost_driver = { 182 182 .driver = { 183 183 .name = "ingenic-ost", 184 - #ifdef CONFIG_PM_SUSPEND 185 - .pm = &ingenic_ost_pm_ops, 186 - #endif 184 + .pm = pm_sleep_ptr(&ingenic_ost_pm_ops), 187 185 .of_match_table = ingenic_ost_of_match, 188 186 }, 189 187 };