[<prev] [next>] [day] [month] [year] [list]
Message-ID: <BN6PR04MB06607ABEE082DF0A20E102ACA3BC0@BN6PR04MB0660.namprd04.prod.outlook.com>
Date: Thu, 14 May 2020 16:04:34 -0700
From: Jonathan Bakker <xc-racer2@...e.ca>
To: sre@...nel.org, krzk@...nel.org, jonghwa3.lee@...sung.com,
tglx@...utronix.de, kstewart@...uxfoundation.org,
baolin.wang7@...il.com, linux-pm@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Jonathan Bakker <xc-racer2@...e.ca>
Subject: [PATCH 09/10] 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@...e.ca>
---
drivers/power/supply/charger-manager.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index 4ad3dd754abf..f0ef8a10891c 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 */
--
2.20.1
Powered by blists - more mailing lists