media: atmel: atmel-isc: fix INIT_WORK misplacement
authorEugen Hristev <eugen.hristev@microchip.com>
Fri, 12 Apr 2019 10:19:46 +0000 (06:19 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:21:29 +0000 (09:21 +0100)
commit59fd7d5fcae1c9f53fd86d6ed5c814ac6df9a85d
tree502806da63e8bca9662d5d02caea43735baffd6d
parent9656c3d14cebe392200005ec906da06e9dbb29bd
media: atmel: atmel-isc: fix INIT_WORK misplacement

commit 79199002db5c571e335131856b3ff057ffd9f3c0 upstream.

In case the completion function failes, unbind will be called
which will call cancel_work for awb_work.
This will trigger a WARN message from the workqueue.
To avoid this, move the INIT_WORK call at the start of the completion
function. This way the work is always initialized, which corresponds
to the 'always canceled' unbind code.

Fixes: 93d4a26c3d ("[media] atmel-isc: add the isc pipeline function")

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/atmel/atmel-isc.c