Commit 683aa86e authored by Jonathan Bakker's avatar Jonathan Bakker Committed by Sebastian Reichel

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: default avatarJonathan Bakker <xc-racer2@live.ca>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent c1f73028
...@@ -1311,8 +1311,8 @@ static struct charger_desc *of_cm_parse_desc(struct device *dev) ...@@ -1311,8 +1311,8 @@ static struct charger_desc *of_cm_parse_desc(struct device *dev)
desc->battery_present = battery_stat; desc->battery_present = battery_stat;
/* chargers */ /* chargers */
of_property_read_u32(np, "cm-num-chargers", &num_chgs); num_chgs = of_property_count_strings(np, "cm-chargers");
if (num_chgs) { if (num_chgs > 0) {
int i; int i;
/* Allocate empty bin at the tail of array */ /* Allocate empty bin at the tail of array */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment