mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
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:
parent
c1f73028f7
commit
683aa86eb1
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user