summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJonathan Bakker <xc-racer2@live.ca>2020-05-14 16:04:34 -0700
committerSebastian Reichel <sre@kernel.org>2020-08-28 19:27:45 +0200
commit683aa86eb16ab8cf91075654d08ef7409f160e35 (patch)
tree23997ae6f8b51ac884640fd13387559ce5e17458 /drivers
parentc1f73028f75df43689feda4bc70573b7d18a618e (diff)
downloadlwn-683aa86eb16ab8cf91075654d08ef7409f160e35.tar.gz
lwn-683aa86eb16ab8cf91075654d08ef7409f160e35.zip
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')
-rw-r--r--drivers/power/supply/charger-manager.c4
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 */