Re: [PATCH v2] net: ethernet: bgmac: use pm_ptr() to clean up PM code
From: Andrew Lunn
Date: Tue Mar 10 2026 - 14:52:37 EST
> As you suggested, I've swapped the #ifdef guards for pm_ptr() and
> marked the platform wrappers with __maybe_unused. This way, the compiler
> always sees the code, but the linker will still toss it out if power
> management isn't being used.
Think about that some more. If the compiler always sees the code, and
then throws it out at the optimizer stage, why do you need
__maybe_unused?
Do you try building this without the __maybe_unused.? Did you look at
other examples of pm_ptr()? Do they also have __maybe_used?
Andrew