|
@@ -724,6 +724,14 @@ static int charger_init_hw_regs(struct axp288_chrg_info *info)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+static void axp288_charger_cancel_work(void *data)
|
|
|
+{
|
|
|
+ struct axp288_chrg_info *info = data;
|
|
|
+
|
|
|
+ cancel_work_sync(&info->otg.work);
|
|
|
+ cancel_work_sync(&info->cable.work);
|
|
|
+}
|
|
|
+
|
|
|
static int axp288_charger_probe(struct platform_device *pdev)
|
|
|
{
|
|
|
int ret, i, pirq;
|
|
@@ -772,6 +780,11 @@ static int axp288_charger_probe(struct platform_device *pdev)
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+ /* Cancel our work on cleanup, register this before the notifiers */
|
|
|
+ ret = devm_add_action(dev, axp288_charger_cancel_work, info);
|
|
|
+ if (ret)
|
|
|
+ return ret;
|
|
|
+
|
|
|
/* Register for extcon notification */
|
|
|
INIT_WORK(&info->cable.work, axp288_charger_extcon_evt_worker);
|
|
|
info->cable.nb.notifier_call = axp288_charger_handle_cable_evt;
|