summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2020-05-01 16:30:43 +0200
committerSebastian Reichel <sebastian.reichel@collabora.com>2020-05-01 16:48:02 +0200
commit97ed79f4931964069fc3be7ae5122c3026273f9e (patch)
tree270be85cf75f9fdfcb9ec8c592684af929a261e5 /drivers/power
parentpower: supply: core: hide unused HWMON labels (diff)
downloadlinux-97ed79f4931964069fc3be7ae5122c3026273f9e.tar.xz
linux-97ed79f4931964069fc3be7ae5122c3026273f9e.zip
power: charger-manager: clarify num_properties starting value
Initialize num_properties with length of the copied array instead of relying on previously memcpy'd value. This makes it clear how the array and the counter are related. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/charger-manager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index 415a9efa6816..2ef53dc1f2fb 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -1729,7 +1729,7 @@ static int charger_manager_probe(struct platform_device *pdev)
memcpy(properties, default_charger_props,
sizeof(enum power_supply_property) *
ARRAY_SIZE(default_charger_props));
- num_properties = psy_default.num_properties;
+ num_properties = ARRAY_SIZE(default_charger_props);
/* Find which optional psy-properties are available */
fuel_gauge = power_supply_get_by_name(desc->psy_fuel_gauge);