a194eaba146550afa270fa11233b03d48bdb4323
[oweals/openwrt.git] /
1 From d06677b96fc10122363028dea9ca06e5f9899865 Mon Sep 17 00:00:00 2001
2 From: Chen-Yu Tsai <wens@csie.org>
3 Date: Mon, 22 Jul 2019 22:20:55 +0800
4 Subject: [PATCH] staging: bcm2835-codec: set device_caps in struct
5  video_device
6
7 Instead of filling in the struct v4l2_capability device_caps
8 field, fill in the struct video_device device_caps field.
9
10 That way the V4L2 core knows what the capabilities of the
11 video device are.
12
13 This is similar to a cleanup series by Hans Verkuil [1].
14
15 [1] https://www.spinics.net/lists/linux-media/msg153313.html
16
17 Signed-off-by: Chen-Yu Tsai <wens@csie.org>
18 ---
19  .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c   | 3 +--
20  1 file changed, 1 insertion(+), 2 deletions(-)
21
22 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
23 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
24 @@ -945,8 +945,6 @@ static int vidioc_querycap(struct file *
25         strncpy(cap->card, MEM2MEM_NAME, sizeof(cap->card) - 1);
26         snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
27                  MEM2MEM_NAME);
28 -       cap->device_caps = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING;
29 -       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
30         return 0;
31  }
32  
33 @@ -2600,6 +2598,7 @@ static int bcm2835_codec_create(struct p
34         vfd = &dev->vfd;
35         vfd->lock = &dev->dev_mutex;
36         vfd->v4l2_dev = &dev->v4l2_dev;
37 +       vfd->device_caps = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING;
38  
39         switch (role) {
40         case DECODE: