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

power: supply: axp288_charger: Move init_hw_regs call before supply registration

Move the charger_init_hw_regs() above the power_supply_register call,
the axp288_charger_usb_set_property() uses axp288_chrg_info.max_cv and
.max_cc which get set by charger_init_hw_regs().
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent 42e2008a
...@@ -836,6 +836,10 @@ static int axp288_charger_probe(struct platform_device *pdev) ...@@ -836,6 +836,10 @@ static int axp288_charger_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, info); platform_set_drvdata(pdev, info);
mutex_init(&info->lock); mutex_init(&info->lock);
ret = charger_init_hw_regs(info);
if (ret)
return ret;
/* Register with power supply class */ /* Register with power supply class */
charger_cfg.drv_data = info; charger_cfg.drv_data = info;
info->psy_usb = devm_power_supply_register(dev, &axp288_charger_desc, info->psy_usb = devm_power_supply_register(dev, &axp288_charger_desc,
...@@ -890,10 +894,6 @@ static int axp288_charger_probe(struct platform_device *pdev) ...@@ -890,10 +894,6 @@ static int axp288_charger_probe(struct platform_device *pdev)
} }
} }
ret = charger_init_hw_regs(info);
if (ret)
return ret;
return 0; return 0;
} }
......
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