summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenny Ho <hsiufangho@google.com>2023-10-27 21:50:02 +0800
committerJenny Ho <hsiufangho@google.com>2023-10-27 13:55:30 +0000
commitb56a1fc60a11992cb57fd59f0869729c42d71cfe (patch)
tree90103e4d0e530f84e86bed89f6c9d31b1dc8f030
parent873bf5a7a503e057acbbfecb2c290aa634037706 (diff)
downloadbms-b56a1fc60a11992cb57fd59f0869729c42d71cfe.tar.gz
max1720x_battery: fix unable to read /dev/maxfg_history
The failure to read correctly is due to the lack of corresponding page_size. Add back the correct corresponding value. Bug: 308134661 Change-Id: Ie0b2c8361aee0a35ad67dbf16c0acd2c56014ce6 Signed-off-by: Jenny Ho <hsiufangho@google.com>
-rw-r--r--max1720x_battery.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/max1720x_battery.c b/max1720x_battery.c
index fc3d180..a7b7e96 100644
--- a/max1720x_battery.c
+++ b/max1720x_battery.c
@@ -822,6 +822,7 @@ static int max1720x_history_read(struct max1720x_chip *chip,
} else if (hi->history_count != 0) {
const int size = hi->history_count * chip->history_page_size;
+ hi->page_size = chip->history_page_size;
hi->history = batt_alloc_array(size, sizeof(u16));
if (!hi->history) {
hi->history_count = -ENOMEM;