diff options
author | Jonathan Bakker <xc-racer2@live.ca> | 2020-05-14 16:04:34 -0700 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2020-08-28 19:27:45 +0200 |
commit | 683aa86eb16ab8cf91075654d08ef7409f160e35 (patch) | |
tree | 23997ae6f8b51ac884640fd13387559ce5e17458 /drivers/power | |
parent | c1f73028f75df43689feda4bc70573b7d18a618e (diff) |
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>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/supply/charger-manager.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c index 5f536284d2ca..07992821e252 100644 --- a/drivers/power/supply/charger-manager.c +++ b/drivers/power/supply/charger-manager.c @@ -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 */ |