OSDN Git Service

power: supply: core: Use device_property_string_array_count()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 2 Feb 2022 18:23:25 +0000 (20:23 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Fri, 11 Feb 2022 18:54:21 +0000 (19:54 +0100)
Use device_property_string_array_count() to get number of strings
in a string array property.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/power_supply_core.c

index 1a2440e..8dbd119 100644 (file)
@@ -283,8 +283,7 @@ static int power_supply_check_supplies(struct power_supply *psy)
        if (!psy->dev.parent)
                return 0;
 
-       nval = device_property_read_string_array(psy->dev.parent,
-                                                "supplied-from", NULL, 0);
+       nval = device_property_string_array_count(psy->dev.parent, "supplied-from");
        if (nval <= 0)
                return 0;