summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2016-12-21 15:36:50 +0100
committerSebastian Reichel <sre@kernel.org>2017-01-04 22:02:47 +0100
commitd96e07350ab912420f4edc39017660591b0d177c (patch)
treeafb15b567d1507a368c4bc059c0b236ff086a2af
parent42e2008a66a7e17ca0c4382ff676a9cfe7a633bd (diff)
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: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
-rw-r--r--drivers/power/supply/axp288_charger.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/power/supply/axp288_charger.c b/drivers/power/supply/axp288_charger.c
index 250dd700226f..1588efd88a1c 100644
--- a/drivers/power/supply/axp288_charger.c
+++ b/drivers/power/supply/axp288_charger.c
@@ -836,6 +836,10 @@ static int axp288_charger_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, info);
mutex_init(&info->lock);
+ ret = charger_init_hw_regs(info);
+ if (ret)
+ return ret;
+
/* Register with power supply class */
charger_cfg.drv_data = info;
info->psy_usb = devm_power_supply_register(dev, &axp288_charger_desc,
@@ -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;
}