power: supply: ab8500_fg: Allocate wq in probe
authorLinus Walleij <linus.walleij@linaro.org>
Sat, 23 Apr 2022 17:27:27 +0000 (19:27 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Tue, 3 May 2022 15:10:40 +0000 (17:10 +0200)
commit010ddb813f3554cbbf8bd13b731452236a2c8017
tree15c112ee58741e559d9c3a60f6e1ee43186db903
parentf61509a6f0b70f5bedea34efaf8065621689bd7a
power: supply: ab8500_fg: Allocate wq in probe

The workqueue is allocated in bind() but all interrupts are
registered in probe().

Some interrupts put work on the workqueue, which can have
bad side effects.

Allocate the workqueue in probe() instead, destroy it in
.remove() and make unbind() simply flush the workqueue.

Fixes: 1c1f13a006ed ("power: supply: ab8500: Move to componentized binding")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/ab8500_fg.c