]> git.baikalelectronics.ru Git - kernel.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 12:23:35 +0000 (14:23 +0200)
commitced01651968ce40ffcf4b0c3d24368e44269c3ef
treec098acb305e512659a7ccca954c6f8a25ad5b6e7
parent36d83b8897728241e4f04f1e2e08c6cffafba047
power: supply: sbs-charger: Don't cancel work that is not initialized

[ Upstream commit c43ad22397183f8346801f1af6d8e74437a782e4 ]

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: a8dee36b0e5e ("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