1 From 7ad713e695d67b78b3cb69927d099a29593444b1 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 30 Sep 2020 12:12:32 +0100
4 Subject: [PATCH] staging: bcm2835-codec: Use a define the completion
7 Hiding a use of "HZ" as a timeout is a little nasty.
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
11 .../vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 6 +++++-
12 1 file changed, 5 insertions(+), 1 deletion(-)
14 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
15 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
16 @@ -89,6 +89,9 @@ static const char * const components[] =
20 +/* Timeout for stop_streaming to allow all buffers to return */
21 +#define COMPLETE_TIMEOUT (2 * HZ)
26 @@ -2366,7 +2369,8 @@ static void bcm2835_codec_stop_streaming
27 while (atomic_read(&port->buffers_with_vpu)) {
28 v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: Waiting for buffers to be returned - %d outstanding\n",
29 __func__, atomic_read(&port->buffers_with_vpu));
30 - ret = wait_for_completion_timeout(&ctx->frame_cmplt, HZ);
31 + ret = wait_for_completion_timeout(&ctx->frame_cmplt,
34 v4l2_err(&ctx->dev->v4l2_dev, "%s: Timeout waiting for buffers to be returned - %d outstanding\n",