[prev in list] [next in list] [prev in thread] [next in thread]
List: ibm-acpi-devel
Subject: [ibm-acpi-devel] [PATCH] thinkpad_acpi: don't overwrite supported battery operations
From: Thomas Weißschuh <linux () weissschuh ! net>
Date: 2018-06-16 9:39:54
Message-ID: 20180616093954.8435-1-linux () weissschuh ! net
[Download RAW message or body]
Previously the struct containing the supported operations for all
batteries was zeroed every time a battery was probed.
This prevented all batteries except the lastly probed one from being
configured.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
drivers/platform/x86/thinkpad_acpi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index cae9b0595692..1fc6a667dbd4 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -9365,7 +9365,9 @@ static int tpacpi_battery_probe(int battery)
{
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
* 2) Check for support
@@ -9598,6 +9600,7 @@ static struct acpi_battery_hook battery_hook = {
static int __init tpacpi_battery_init(struct ibm_init_struct *ibm)
{
+ memset(&battery_info, 0, sizeof(battery_info));
battery_hook_register(&battery_hook);
return 0;
}
--
2.17.1
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic