Skip to content
Commit 0df6e32b authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Sebastian Reichel
Browse files

power: pm2301-charger: use __maybe_unused to hide pm functions



The pm2301 charger driver uses nested #ifdefs to check for both
CONFIG_PM and CONFIG_PM_SLEEP in an attempt to hide its
suspend and runtime-pm operations when they are unused, but
it does not hide the clear_lpn_pin() function in the same
way, so we get a build warning when everything is
disabled:

drivers/power/pm2301_charger.c:123:13: error: 'clear_lpn_pin' defined but not used [-Werror=unused-function]

This removes all the #ifdef and instead uses __maybe_unused
annotations to let the compiler know it can silently drop
the function definition.

For the PM2XXX_PM_OPS, we can use an IS_ENABLED() check
to avoid defining the structure when CONFIG_PM is not set without
the #ifdef.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent 298cb0f1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment