power: supply: charger-manager: Count cm-chargers property directly

Rather than having a cm-chargers and a separate cm-num-chargers
property, simply count the entries in cm-chargers.

Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
Jonathan Bakker 2020-05-14 16:04:34 -07:00 committed by Sebastian Reichel
parent c1f73028f7
commit 683aa86eb1
1 changed files with 2 additions and 2 deletions

View File

@ -1311,8 +1311,8 @@ static struct charger_desc *of_cm_parse_desc(struct device *dev)
desc->battery_present = battery_stat;
/* chargers */
of_property_read_u32(np, "cm-num-chargers", &num_chgs);
if (num_chgs) {
num_chgs = of_property_count_strings(np, "cm-chargers");
if (num_chgs > 0) {
int i;
/* Allocate empty bin at the tail of array */