提交 d22296d9 编写于 作者: T Thomas Weißschuh 提交者: Andy Shevchenko

platform/x86: thinkpad_acpi: Fix multi-battery bug

The struct containing the supported operations for all batteries is
being zeroed on each battery probe.  This prevents all other batteries
except the lastly probed one from being configured.
Signed-off-by: NThomas Weißschuh <linux@weissschuh.net>
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
上级 6640ee62
...@@ -9374,7 +9374,9 @@ static int tpacpi_battery_probe(int battery) ...@@ -9374,7 +9374,9 @@ static int tpacpi_battery_probe(int battery)
{ {
int ret = 0; int ret = 0;
memset(&battery_info, 0, sizeof(struct tpacpi_battery_driver_data)); memset(&battery_info.batteries[battery], 0,
sizeof(battery_info.batteries[battery]));
/* /*
* 1) Get the current start threshold * 1) Get the current start threshold
* 2) Check for support * 2) Check for support
...@@ -9620,6 +9622,8 @@ static const struct tpacpi_quirk battery_quirk_table[] __initconst = { ...@@ -9620,6 +9622,8 @@ static const struct tpacpi_quirk battery_quirk_table[] __initconst = {
static int __init tpacpi_battery_init(struct ibm_init_struct *ibm) static int __init tpacpi_battery_init(struct ibm_init_struct *ibm)
{ {
memset(&battery_info, 0, sizeof(battery_info));
tp_features.battery_force_primary = tpacpi_check_quirks( tp_features.battery_force_primary = tpacpi_check_quirks(
battery_quirk_table, battery_quirk_table,
ARRAY_SIZE(battery_quirk_table)); ARRAY_SIZE(battery_quirk_table));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册