Commit a314fae3 authored by Hans de Goede's avatar Hans de Goede Committed by Sebastian Reichel

power: supply: bq24190_charger: Always call power_supply_get_battery_info()

power_supply_get_battery_info() now also supports getting battery_info
on boards not using dt/of. Remove the of_node check. If neither of nor
other battery-info is present the function will fail making this change
a no-op in that case.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 5e8c1dc7
...@@ -1693,8 +1693,7 @@ static int bq24190_get_config(struct bq24190_dev_info *bdi) ...@@ -1693,8 +1693,7 @@ static int bq24190_get_config(struct bq24190_dev_info *bdi)
dev_warn(bdi->dev, "invalid value for %s: %u\n", s, v); dev_warn(bdi->dev, "invalid value for %s: %u\n", s, v);
} }
if (bdi->dev->of_node && if (!power_supply_get_battery_info(bdi->charger, &info)) {
!power_supply_get_battery_info(bdi->charger, &info)) {
v = info->precharge_current_ua / 1000; v = info->precharge_current_ua / 1000;
if (v >= BQ24190_REG_PCTCC_IPRECHG_MIN if (v >= BQ24190_REG_PCTCC_IPRECHG_MIN
&& v <= BQ24190_REG_PCTCC_IPRECHG_MAX) && v <= BQ24190_REG_PCTCC_IPRECHG_MAX)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment