mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-28 03:40:04 +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
1 changed files with 2 additions and 2 deletions
|
@ -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 */
|
||||||
|
|
Loading…
Reference in a new issue