ab8500_bm: Make the battery Device Tree node reference less cryptic

Let's rename the Device Tree node which contains information about
an attached battery to something more easily readable.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
Lee Jones 2012-11-30 11:38:52 +00:00
parent bdc56b4403
commit 215cf5c93d
1 changed files with 6 additions and 6 deletions

View File

@ -457,18 +457,18 @@ int __devinit ab8500_bm_of_probe(struct device *dev,
struct abx500_bm_data *bm) struct abx500_bm_data *bm)
{ {
struct batres_vs_temp *tmp_batres_tbl; struct batres_vs_temp *tmp_batres_tbl;
struct device_node *np_bat_supply; struct device_node *battery_node;
const char *btech; const char *btech;
int i; int i;
/* get phandle to 'battery-info' node */ /* get phandle to 'battery-info' node */
np_bat_supply = of_parse_phandle(np, "battery", 0); battery_node = of_parse_phandle(np, "battery", 0);
if (!np_bat_supply) { if (!battery_node) {
dev_err(dev, "battery node or reference missing\n"); dev_err(dev, "battery node or reference missing\n");
return -EINVAL; return -EINVAL;
} }
btech = of_get_property(np_bat_supply, "stericsson,battery-type", NULL); btech = of_get_property(battery_node, "stericsson,battery-type", NULL);
if (!btech) { if (!btech) {
dev_warn(dev, "missing property battery-name/type\n"); dev_warn(dev, "missing property battery-name/type\n");
return -EINVAL; return -EINVAL;
@ -484,7 +484,7 @@ int __devinit ab8500_bm_of_probe(struct device *dev,
bm->bat_type[BATTERY_UNKNOWN].normal_vol_lvl = 4200; bm->bat_type[BATTERY_UNKNOWN].normal_vol_lvl = 4200;
} }
if (of_property_read_bool(np_bat_supply, "thermistor-on-batctrl")) { if (of_property_read_bool(battery_node, "thermistor-on-batctrl")) {
if (strncmp(btech, "LION", 4) == 0) if (strncmp(btech, "LION", 4) == 0)
tmp_batres_tbl = temp_to_batres_tbl_9100; tmp_batres_tbl = temp_to_batres_tbl_9100;
else else
@ -500,7 +500,7 @@ int __devinit ab8500_bm_of_probe(struct device *dev,
for (i = 0; i < bm->n_btypes; ++i) for (i = 0; i < bm->n_btypes; ++i)
bm->bat_type[i].batres_tbl = tmp_batres_tbl; bm->bat_type[i].batres_tbl = tmp_batres_tbl;
of_node_put(np_bat_supply); of_node_put(battery_node);
return 0; return 0;
} }