Re: [PATCH 02/10] power: supply: bq25890: Ensure pump_express_work is cancelled on remove

Marek Vasut
2022-11-27T21:36:10Z

On 11/27/22 19:02, Hans de Goede wrote:
> The pump_express_work which gets queued from an external_power_changed
> callback might be pending / running on remove() (or on probe failure).
>
> Add a devm action cancelling the work, to ensure that it is cancelled.
>
> Note the devm action is added before devm_power_supply_register(), making
> it run after devm unregisters the power_supply, so that the work cannot
> be queued anymore (this is also why a devm action is used for this).
>
> Fixes: 48f45b094dbb ("power: supply: bq25890: Support higher charging voltages through Pump Express+ protocol")
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

A comment in the code matching the last paragraph of this commit message
would be helpful I think.

Reviewed-by: Marek Vasut <marex@denx.de>