Hi Wentao,
On Mon Apr 7, 2025 at 10:39 PM -03, Wentao Liang wrote:
In tpacpi_battery_init(), the return value of tpacpi_check_quirks() needs to be checked. The battery should not be hooked if there is no matched battery information in quirk table.
Why is this the case? What problem is this fixing?
It seems only a few devices are listed in battery_quirk_table, and the comment above it suggests it is just a fixup:
/* * Individual addressing is broken on models that expose the * primary battery as BAT1. */
Furthermore, I looked at uses of this quirk in the code and it's absence doesn't seem critical.
Add an error check and return -ENODEV immediately if the device fail the check.
I bring this up because it has the potential to cause a regression on a lot of devices.