Re: [PATCH] net: bgmac: scope bgmac_enet_suspend() and bgmac_enet_resume() to CONFIG_PM

From: Andrew Lunn

Date: Mon Mar 09 2026 - 09:54:10 EST


On Mon, Mar 09, 2026 at 09:02:38AM +0000, Pengpeng Hou wrote:
> In current linux.git (1954c4f01220), bgmac_enet_suspend() and
> bgmac_enet_resume() are defined and declared unconditionally. However,
> their only in-tree callers are within the platform driver's PM callbacks
> in bgmac-platform.c, which are already guarded by #ifdef CONFIG_PM.
>
> Match the helper scope to their callers by wrapping the definitions in
> CONFIG_PM and providing no-op stubs in the header. This fixes the
> config-scope mismatch and avoids unnecessary code inclusion when
> power management is disabled.

Please use pm_ptr() instead. You should then be able to remove all
#ifdef CONFIG_PM. That is better for build testing.

Andrew

---
pw-bot: cr