summaryrefslogtreecommitdiff
path: root/drivers/power/ab8500_bmdata.c
diff options
context:
space:
mode:
authorRajanikanth H.V <rajanikanth.hv@stericsson.com>2012-11-29 00:57:45 +0530
committerLee Jones <lee.jones@linaro.org>2012-12-11 08:43:51 +0000
commitf5695a39833a2946479f6215f3afc4f672333713 (patch)
tree34bee285578e3743c370d680fa5cbd601387363e /drivers/power/ab8500_bmdata.c
parenteba3b670a9166a91be5a11fe33290dca6b9457a2 (diff)
ab8500: remove explicit handling of battery type
property, battery-type shall be one of supported technology type instead blank - refer: Documentation/devicetree/bindings/power_supply/ab8500/fg.txt for the list supported types - this patch appends to ab8500 bm devs DT binding patch set ref: commit-id e0f1abeba5c2d8a2183566717d99294fd1a29c2e git://git.infradead.org/battery-2.6.git - promote ab8500_fg probe to happen before ab8500_btemp probe as btemp driver depends on fuelgauge list, ref: ab8500_fg_get(...) Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
Diffstat (limited to 'drivers/power/ab8500_bmdata.c')
-rw-r--r--drivers/power/ab8500_bmdata.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
index 03cc528425cb..f16b60cd67de 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,9 @@ 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);
+ 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 +504,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 {