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-next>] [day] [month] [year] [list]
Message-Id: <1354558375-15110-1-git-send-email-rajanikanth.hv@linaro.org>
Date:	Mon,  3 Dec 2012 23:42:54 +0530
From:	"Rajanikanth H.V" <rajanikanth.hv@...aro.org>
To:	anton.vorontsov@...aro.org
Cc:	francescolavra.fl@...il.com, rob.herring@...xeda.com,
	lee.jones@...aro.org, arnd@...db.de, linus.walleij@...ricsson.com,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	linaro-dev@...ts.linaro.org, patches@...aro.org,
	STEricsson_nomadik_linux@...t.st.com, rajanikanth.hv@...ricsson.com
Subject: [PATCH 1/2] ab8500: remove explicit handling of battery type

From: "Rajanikanth H.V" <rajanikanth.hv@...ricsson.com>

dt property, 'battery-type' shall be one of supported technology type
instead blank.
refer:Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
      for the list of supported types

thanks to Francesco Lavra for highlighting missing of_node_put(...)

for '3.7-rc5': of git://git.infradead.org/battery-2.6.git

Acked-by: Lee Jones <lee.jones@...aro.org>
Signed-off-by: Rajanikanth H.V <rajanikanth.hv@...ricsson.com>
---
 drivers/power/ab8500_bmdata.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
index 03cc528..2230b2c 100644
--- a/drivers/power/ab8500_bmdata.c
+++ b/drivers/power/ab8500_bmdata.c
@@ -461,7 +461,6 @@ bmdevs_of_probe(struct device *dev,
 	struct  device_node *np_bat_supply;
 	struct	abx500_bm_data *bat;
 	const char *btech;
-	char bat_tech[8];
 	int i, thermistor;
 
 	*battery = &ab8500_bm_data;
@@ -488,12 +487,10 @@ bmdevs_of_probe(struct device *dev,
 		"stericsson,battery-type", NULL);
 	if (!btech) {
 		dev_warn(dev, "missing property battery-name/type\n");
-		strcpy(bat_tech, "UNKNOWN");
-	} else {
-		strcpy(bat_tech, btech);
+		of_node_put(np_bat_supply);
+		return -EINVAL;
 	}
-
-	if (strncmp(bat_tech, "LION", 4) == 0) {
+	if (strncmp(btech, "LION", 4) == 0) {
 		bat->no_maintenance  = true;
 		bat->chg_unknown_bat = true;
 		bat->bat_type[BATTERY_UNKNOWN].charge_full_design = 2600;
@@ -508,7 +505,7 @@ bmdevs_of_probe(struct device *dev,
 		if (thermistor == NTC_EXTERNAL) {
 			btype->batres_tbl =
 				temp_to_batres_tbl_ext_thermistor;
-		} else if (strncmp(bat_tech, "LION", 4) == 0) {
+		} else if (strncmp(btech, "LION", 4) == 0) {
 			btype->batres_tbl =
 				temp_to_batres_tbl_9100;
 		} else {
-- 
1.7.10.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