power: bq24190: Fix ignored supplicants
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Mon, 5 Jan 2015 08:51:48 +0000 (09:51 +0100)
committerSebastian Reichel <sre@kernel.org>
Tue, 20 Jan 2015 12:58:32 +0000 (13:58 +0100)
The driver mismatched 'num_supplicants' with 'num_supplies' of
power_supply structure.

It provided list of supplicants (power_supply.supplied_to) but did
not set the number of supplicants. Instead it set the num_supplies which
is used when iterating over number of supplies (power_supply.supplied_from).

As a result the list of supplicants was ignored by core because its size
was 0.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: <stable@vger.kernel.org>
Fixes: d7bf353fd0aa ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/bq24190_charger.c

index ad3ff8fbfbbb083a897a14cc13622904108a4368..e4c95e1a6733e4f00cd54087db6ff18a01c36ce0 100644 (file)
@@ -929,7 +929,7 @@ static void bq24190_charger_init(struct power_supply *charger)
        charger->properties = bq24190_charger_properties;
        charger->num_properties = ARRAY_SIZE(bq24190_charger_properties);
        charger->supplied_to = bq24190_charger_supplied_to;
-       charger->num_supplies = ARRAY_SIZE(bq24190_charger_supplied_to);
+       charger->num_supplicants = ARRAY_SIZE(bq24190_charger_supplied_to);
        charger->get_property = bq24190_charger_get_property;
        charger->set_property = bq24190_charger_set_property;
        charger->property_is_writeable = bq24190_charger_property_is_writeable;