diff options
| author | Nathan Chancellor <nathan@kernel.org> | 2026-06-05 08:52:28 +0300 |
|---|---|---|
| committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2026-06-05 22:45:25 +0300 |
| commit | 4acc0138c4f2fba453da5a5076ad2bba08a7463b (patch) | |
| tree | eb32c0d4f1c7b986d7df03b6b65f9021bfd00d2e /include/linux/processor.h | |
| parent | 7e541f6dbd05921d0bbb99646028cb9982535707 (diff) | |
| download | linux-4acc0138c4f2fba453da5a5076ad2bba08a7463b.tar.xz | |
power: supply: max17042_battery: Use modern PM ops to clear up warning
When building for a platform that does not have power management, such
as s390, there is an unused function warning, as
max17042_suspend_soc_alerts() is only used in max17042_suspend(), which
is under a CONFIG_PM_SLEEP #ifdef.
drivers/power/supply/max17042_battery.c:957:13: error: 'max17042_suspend_soc_alerts' defined but not used [-Werror=unused-function]
957 | static void max17042_suspend_soc_alerts(struct max17042_chip *chip)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the modern DEFINE_SIMPLE_DEV_PM_OPS(), which allows the compiler to
see the functions as used while allowing it to eliminate them as unused
during the optimization phase. Use pm_ptr() to allow the compiler to
drop max17042_pm_ops when there is no PM support.
Fixes: 601885ffb5e9 ("power: supply: max17042_battery: Keep only critical alerts during suspend")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20260604-max17042_battery-fix-unused-suspend_soc_alerts-v1-1-3562a68e6f36@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'include/linux/processor.h')
0 files changed, 0 insertions, 0 deletions
