Commit b6c57b7
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: ab58016 ("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>1 parent ed0e64d commit b6c57b7
1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2391 | 2391 | | |
2392 | 2392 | | |
2393 | 2393 | | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
2394 | 2400 | | |
2395 | 2401 | | |
2396 | 2402 | | |
2397 | | - | |
2398 | | - | |
2399 | | - | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
2400 | 2406 | | |
2401 | 2407 | | |
2402 | 2408 | | |
2403 | 2409 | | |
2404 | 2410 | | |
2405 | 2411 | | |
2406 | 2412 | | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
2407 | 2416 | | |
2408 | 2417 | | |
2409 | 2418 | | |
| |||
0 commit comments