workqueue: Add resource managed version of delayed work init
authorMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Tue, 23 Mar 2021 13:56:17 +0000 (15:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Mar 2021 14:22:39 +0000 (15:22 +0100)
commit0341ce5443949588e93581b49b934cdde2befbf8
tree9c1a052145e3588d2315500b141f39b297403231
parent53f95c55349e75b73f69ce36b0ae2a83b3f28fde
workqueue: Add resource managed version of delayed work init

A few drivers which need a delayed work-queue must cancel work at driver
detach. Some of those implement remove() solely for this purpose. Help
drivers to avoid unnecessary remove and error-branch implementation by
adding managed verision of delayed work initialization. This will also
help drivers to avoid mixing manual and devm based unwinding when other
resources are handled by devm.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/51769ea4668198deb798fe47fcfb5f5288d61586.1616506559.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/devm-helpers.h [new file with mode: 0644]