summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-02-02 21:23:25 +0300
committerSebastian Reichel <sebastian.reichel@collabora.com>2022-02-11 21:54:21 +0300
commit1c97db1747b756611f0d26ea7fb2ed2d93f90fcc (patch)
tree6728be18a4b5bfd1210a9a9a81288866597a80af /drivers/power
parente83c7204f185c598b5b933ea5511b062b26afb67 (diff)
downloadlinux-1c97db1747b756611f0d26ea7fb2ed2d93f90fcc.tar.xz
power: supply: core: Use device_property_string_array_count()
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>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/power_supply_core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index 1a2440e212a7..8dbd1197cc62 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -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;