lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1348589574-25655-32-git-send-email-mathieu.poirier@linaro.org>
Date:	Tue, 25 Sep 2012 10:12:28 -0600
From:	mathieu.poirier@...aro.org
To:	linux-kernel@...r.kernel.org, cbou@...l.ru, dwmw2@...radead.org
Cc:	mathieu.poirier@...aro.org
Subject: [PATCH 31/57] power: ab8500_fg: fix to use correct battery charge full design

From: Rajkumar Kasirajan <rajkumar.kasirajan@...ricsson.com>

If battery is not identified while fg probe, mah_max_design gets
initialized with unknown battery's charge full design. Reinitialize
mah_max_design if battery is identified after fg probe.

Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@...ricsson.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@...aro.org>
Reviewed-by: Jonas ABERG <jonas.aberg@...ricsson.com>
Reviewed-by: Vijaya Kumar K-1 <vijay.kilari@...ricsson.com>
Reviewed-by: Marcus COOPER <marcus.xm.cooper@...ricsson.com>
Reviewed-by: Olivier CLERGEAUD <olivier.clergeaud@...ricsson.com>
Reviewed-by: Arun MURTHY <arun.murthy@...ricsson.com>
Reviewed-by: Rupesh KUMAR <rupesh.kumar@...ricsson.com>
Reviewed-by: Rabin VINCENT <rabin.vincent@...ricsson.com>
---
 drivers/power/ab8500_fg.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c
index 0e71e7e..5e4a46b 100644
--- a/drivers/power/ab8500_fg.c
+++ b/drivers/power/ab8500_fg.c
@@ -2258,9 +2258,9 @@ static int ab8500_fg_get_ext_psy_data(struct device *dev, void *data)
 		case POWER_SUPPLY_PROP_TECHNOLOGY:
 			switch (ext->type) {
 			case POWER_SUPPLY_TYPE_BATTERY:
-				if (!di->flags.batt_id_received) {
+				if (!di->flags.batt_id_received &&
+					di->bat->batt_id != BATTERY_UNKNOWN) {
 					const struct abx500_battery_type *b;
-
 					b = &(di->bat->bat_type[di->bat->batt_id]);
 
 					di->flags.batt_id_received = true;
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ