power: supply: core: Fix parsing of battery chemistry/technology
authorDmitry Osipenko <digetx@gmail.com>
Thu, 19 Aug 2021 23:51:11 +0000 (02:51 +0300)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Fri, 20 Aug 2021 16:57:56 +0000 (18:57 +0200)
commitc9398455b046fc7a44b6dd53d9d6fe4b11c21700
treec00524c38d9dd0e330118aa5af77af2dac68ffa7
parenteaa2c490514d2d49c3ef1764530234d07f422289
power: supply: core: Fix parsing of battery chemistry/technology

The power_supply_get_battery_info() fails if device-chemistry property
is missing in a device-tree because error variable is propagated to the
final return of the function, fix it.

Fixes: 4eef766b7d4d ("power: supply: core: Parse battery chemistry/technology")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/power_supply_core.c