mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
power: supply: charger-manager: Make code more readable
Make code more readable. Signed-off-by: Baolin Wang <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
This commit is contained in:
parent
f25a646fbe
commit
a53a68cee8
1 changed files with 7 additions and 7 deletions
|
|
@ -1520,19 +1520,19 @@ static struct charger_desc *of_cm_parse_desc(struct device *dev)
|
|||
/* chargers */
|
||||
of_property_read_u32(np, "cm-num-chargers", &num_chgs);
|
||||
if (num_chgs) {
|
||||
int i;
|
||||
|
||||
/* Allocate empty bin at the tail of array */
|
||||
desc->psy_charger_stat = devm_kcalloc(dev,
|
||||
num_chgs + 1,
|
||||
sizeof(char *),
|
||||
GFP_KERNEL);
|
||||
if (desc->psy_charger_stat) {
|
||||
int i;
|
||||
for (i = 0; i < num_chgs; i++)
|
||||
of_property_read_string_index(np, "cm-chargers",
|
||||
i, &desc->psy_charger_stat[i]);
|
||||
} else {
|
||||
if (!desc->psy_charger_stat)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
for (i = 0; i < num_chgs; i++)
|
||||
of_property_read_string_index(np, "cm-chargers",
|
||||
i, &desc->psy_charger_stat[i]);
|
||||
}
|
||||
|
||||
of_property_read_string(np, "cm-fuel-gauge", &desc->psy_fuel_gauge);
|
||||
|
|
|
|||
Loading…
Reference in a new issue