[PATCH v4 02/15] gpio: brcmstb: Use modern PM macros

Jisheng Zhang jszhang at kernel.org
Wed Nov 19 16:28:22 PST 2025


On Wed, Nov 19, 2025 at 07:45:17PM +0200, Andy Shevchenko wrote:
> On Thu, Nov 20, 2025 at 12:33:14AM +0800, Jisheng Zhang wrote:
> > Use the modern PM macros for the suspend and resume functions to be
> > automatically dropped by the compiler when CONFIG_PM or
> > CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> > 
> > This has the advantage of always compiling these functions in,
> > independently of any Kconfig option. Thanks to that, bugs and other
> > regressions are subsequently easier to catch.
> 
> ...
> 
> >  static const struct dev_pm_ops brcmstb_gpio_pm_ops = {
> > -	.suspend_noirq	= brcmstb_gpio_suspend,
> > -	.resume_noirq = brcmstb_gpio_resume,
> > +	.suspend_noirq = pm_sleep_ptr(brcmstb_gpio_suspend),
> > +	.resume_noirq = pm_sleep_ptr(brcmstb_gpio_resume),
> 
> Can it be DEFINE_NOIRQ_DEV_PM_OPS() / NOIRQ_SYSTEM_SLEEP_PM_OPS()?

Yep I agree with you. But IMHO, it's better to make the
DEFINE_NOIRQ_DEV_PM_OPS() switching as a seperate patch and merge this
series which wants to clean up various #ifdef #endif usages



More information about the linux-arm-kernel mailing list