]> 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)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Thu, 24 Feb 2022 11:16:21 +0000 (12:16 +0100)
commit887fef71734003e608e09412f525966c815ad8ac
tree52748346425cddb0ca464d13d237314dddaae2b8
parent3e90eeb4f3b15304d30351ee58ec68b07187efaf
power: supply: sbs-charger: Don't cancel work that is not initialized

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: c9f603650401 ("power: supply: add sbs-charger driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/sbs-charger.c