Patch "power: supply: axp288_charger: Properly stop work on probe-error / remove" has been added to the 4.15-stable tree
Subsystems (4)
This is a note to let you know that I've just added the patch titled
power: supply: axp288_charger: Properly stop work on probe-error / remove
to the 4.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
power-supply-axp288_charger-properly-stop-work-on-probe-error-remove.patch
and it can be found in the queue-4.15 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Mon Apr 9 10:16:32 CEST 2018
From: Hans de Goede <[email protected]>
Date: Tue, 26 Dec 2017 13:59:09 +0100
Subject: power: supply: axp288_charger: Properly stop work on probe-error / remove
From: Hans de Goede <[email protected]>
[ Upstream commit 165c2357744e41391902a2a72dd170beb60c28d5 ]
Properly stop any work we may have queued on probe-errors / remove.
Rather then adding a remove driver callback for this, and goto style error handling to probe, use a devm_action for this.
The devm_action gets registered before we register any of the extcon notifiers which may queue the work, devm does cleanup in reverse order, so this ensures that the notifiers are removed before we cancel the work.
--- drivers/power/supply/axp288_charger.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/power/supply/axp288_charger.c +13 -0
@@ -785,6 +785,14 @@ static int charger_init_hw_regs(struct areturn 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;
@@ -836,6 +844,11 @@ static int axp288_charger_probe(struct preturn 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[0 ].notifier_call = axp288_charger_handle_cable0_evt;
Patches currently in stable-queue which might be from [email protected] are
queue-4.15/serdev-fix-serdev_uevent-failure-on-acpi-enumerated-serdev-controllers.patch queue-4.15/acpi-video-default-lcd_only-to-true-on-win8-ready-and-newer-machines.patch queue-4.15/bluetooth-hci_bcm-mandate-presence-of-shutdown-and-device-wake-gpio.patch queue-4.15/input-goodix-disable-irqs-while-suspended.patch queue-4.15/asoc-intel-cht_bsw_rt5645-analog-mic-support.patch queue-4.15/power-supply-axp288_charger-properly-stop-work-on-probe-error-remove.patch queue-4.15/pinctrl-baytrail-enable-glitch-filter-for-gpios-used-as-interrupts.patch