]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
power: supply: sbs-charger: Don't cancel work that is not initialized
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 13 Feb 2022 17:07:03 +0000 (18:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:58:12 +0000 (13:58 +0200)
commit2fd1798d0baddd5c0ef5faf52454657f04a21f5c
treead5ba93ba1cda50c83aec9b8da2d5cabff868a2d
parentfd6e4a2679ae9dd2824ca40b02f552a98e6c155d
power: supply: sbs-charger: Don't cancel work that is not initialized

[ Upstream commit de85193cff0d94d030a53656d8fcc41794807bef ]

This driver can use an interrupt or polling in order get the charger's
status.

When using polling, a delayed work is used.

However, the remove() function unconditionally call
cancel_delayed_work_sync(), even if the delayed work is not used and is not
initialized.

In order to fix it, use devm_delayed_work_autocancel() and remove the now
useless remove() function.

Fixes: feb583e37f8a ("power: supply: add sbs-charger driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/power/supply/sbs-charger.c