]> git.dujemihanovic.xyz Git - linux.git/commit
platform/x86: dell-laptop: Do not fail when encountering unsupported batteries
authorArmin Wolf <W_Armin@gmx.de>
Tue, 1 Oct 2024 21:28:35 +0000 (23:28 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sun, 6 Oct 2024 10:31:19 +0000 (12:31 +0200)
commitb6c57b70a343da512e0fdcae9a097b3aa506b9bb
treea7a140f996e05be820be3a82d88478075c5dd85d
parented0e64d85fe79db0472531e6bf43d8fe2524c75c
platform/x86: dell-laptop: Do not fail when encountering unsupported batteries

If the battery hook encounters a unsupported battery, it will
return an error. This in turn will cause the battery driver to
automatically unregister the battery hook.

On machines with multiple batteries however, this will prevent
the battery hook from handling the primary battery, since it will
always get unregistered upon encountering one of the unsupported
batteries.

Fix this by simply ignoring unsupported batteries.

Reviewed-by: Pali Rohár <pali@kernel.org>
Fixes: ab58016c68cc ("platform/x86:dell-laptop: Add knobs to change battery charge settings")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20241001212835.341788-4-W_Armin@gmx.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/dell/dell-laptop.c