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

From: Andy Shevchenko

Date: Wed Nov 19 2025 - 12:45:25 EST


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()?

> };

--
With Best Regards,
Andy Shevchenko