diff options
author | Rajanikanth H.V <rajanikanth.hv@stericsson.com> | 2012-12-04 13:19:22 +0100 |
---|---|---|
committer | Anton Vorontsov <anton@enomsg.org> | 2013-01-06 02:31:15 +0100 |
commit | ed59828bb59683800edd461cabc1f26c2a49034e (patch) | |
tree | 0de85b76f08f09050b00db0a7492f52fb7ded613 /drivers/power/ab8500_bmdata.c | |
parent | Linux 3.8-rc2 (diff) | |
download | linux-ed59828bb59683800edd461cabc1f26c2a49034e.tar.xz linux-ed59828bb59683800edd461cabc1f26c2a49034e.zip |
ab8500: Remove initial "UNKNOWN" battery-type string assignment
DT property 'stericsson,battery-type' shall be one of supported technology
type
Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/power/ab8500_bmdata.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c index 03cc528425cb..2230b2cb7fdb 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 { |